Skip to content

Instantly share code, notes, and snippets.

@MarcosSarges
Created February 18, 2022 00:39
Show Gist options
  • Save MarcosSarges/56b3962905e88504f5e9b8ba0ead84ce to your computer and use it in GitHub Desktop.
Save MarcosSarges/56b3962905e88504f5e9b8ba0ead84ce to your computer and use it in GitHub Desktop.
wrapperBind
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