Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement