SHARE
TWEET

Untitled

a guest Sep 16th, 2019 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. export function createActions<K extends keyof Actions<any>, E>(
  2.   endpoint: string,
  3.   url: string,
  4.   actions: K[],
  5. ): Pick<Actions<E>, K> {
  6.   return {
  7.     item: actions.includes('item') && (
  8.       path: `${url}/:id`,
  9.       endpoint: {
  10.         endpoint: `${endpoint}:id/`,
  11.         method: 'GET',
  12.       },
  13.     )
  14.   };
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top