Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export const controller = ({ loggedUser }: IConArgs) => ({
- async getAll() {
- ...
- },
- async getById(id: IUserId) {
- ...
- },
- ...
- });
- controllers: {
- users: controller({ loggedUser: user })
- }
- IControllers: {
- controllers: {
- users: IFoo
- }
- }
- interface IFoo {
- // TODO: Change `any` to correct return type
- getAll(): Promise<any>;
- getById(id: IUserId): Promise<any>;
- }
- export const controller: (args: IConArgs) => IFoo =
- ({ loggedUser }: IConArgs) => ({ ... });
- export const controller = ({ loggedUser }: IConArgs): IFoo => ({ ... });
Add Comment
Please, Sign In to add comment