You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Binds a function to a type's prototype, allowing it to be called as a method on instances of that type.
*
* @param {Function} type The type whose prototype to bind the function to
* @param {Function} fn The function to bind to the prototype. Must be a named function. It's first argument will be the instance of the type on which it is called, followed by any additional arguments.
*/
const prototypeBind = (type, fn) => {
if (!type || !type.prototype) {
throw new Error('First argument must be a type with a prototype.');