bind

v0.9.6arrow_drop_down
v0.9.6
STATUS
Passing
DOWNLOADS
69
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
931 B
Creates a function that is bound to a context.
1 contributor
Install bind as a package?
Copied
npm i @bit/justin-capalbo.ramda.bind
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
No preview available
modifieddraft
chevron_left
chevron_right
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
const 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`.

Help and resources