Guest User

Untitled

a guest
Oct 23rd, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. export const controller = ({ loggedUser }: IConArgs) => ({
  2. async getAll() {
  3. ...
  4. },
  5.  
  6. async getById(id: IUserId) {
  7. ...
  8. },
  9. ...
  10. });
  11.  
  12. controllers: {
  13. users: controller({ loggedUser: user })
  14. }
  15.  
  16. IControllers: {
  17. controllers: {
  18. users: IFoo
  19. }
  20. }
  21.  
  22. interface IFoo {
  23. // TODO: Change `any` to correct return type
  24. getAll(): Promise<any>;
  25. getById(id: IUserId): Promise<any>;
  26. }
  27.  
  28. export const controller: (args: IConArgs) => IFoo =
  29. ({ loggedUser }: IConArgs) => ({ ... });
  30.  
  31. export const controller = ({ loggedUser }: IConArgs): IFoo => ({ ... });
Add Comment
Please, Sign In to add comment