Type Parameters
- T extends Record<M, BindableFunction<T, any[], unknown[], any>>
- M extends PropertyKey
- A extends any[]
- R extends any
Parameters
- instance: T
- method_name: M
- ...args: A
Returns <
S extends Record<M, BindableFunction<T, any[], unknown[], any>>,
SB extends any[],
SR extends any,
>(
thisArg: S,
) => (...args: SB) => SR
a function that can bind any object obj: S
to the said method
generates a factory function that binds a class-prototype-method (by name) to the passed object
S
(which should be an instance of the class).Example
example with assigned default arguments