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
Rest
...args: A
Returns (<S, SB, SR>(thisArg: S) => ((...args: SB) => SR))
a function that can bind any object obj: S
to the said method
- <S, SB, SR>(thisArg): ((...args: SB) => SR)
Type Parameters
- S extends Record<M, BindableFunction<T, any[], unknown[], any>>
- SB extends any[]
- SR extends any
Returns ((...args: SB) => SR)
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