Created
February 18, 2022 00:39
-
-
Save MarcosSarges/56b3962905e88504f5e9b8ba0ead84ce to your computer and use it in GitHub Desktop.
wrapperBind
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const wrapperBind = <T>(controller: T, nameMethod: keyof T): any => { | |
| const func = controller[nameMethod] as unknown as CallableFunction; | |
| return func.bind(controller); | |
| }; | |
| export default wrapperBind; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment