Share your code. Components are building blocks, you are the architect.

utils/bind
v1.0.0
1.0.0
MIT
PUBLIC
0
1     DEPENDENCIES
Build: none
BuildNone
Creates a function that is bound to a context

Please configure Bit as a scoped registry to install components with NPM.Learn more

npm config set '@bit:registry' https://node.bitsrc.io
Use utils/bind in your project
npm i @bit/bit.ramda.utils.bind
Copied

bind (fn:Function, thisObj:Object) : Function

Creates a function that is bound to a context. Note: R.bind does not provide the additional argument-binding capabilities of Function.prototype.bind.

Example

var log = R.bind(console.log, console);
     R.pipe(R.assoc('a', 2), R.tap(log), R.assoc('a', 3))({a: 1}); //=> {a: 3}
     // logs {a: 2}

Arguments

fn: Function

The function to bind to context

thisObj: Object

The context to bind `fn` to

Returns

Function

A function that will execute in the context of `thisObj`.