call

v0.9.6arrow_drop_down
v0.9.6
STATUS
Passing
DOWNLOADS
2
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
1 KB
Returns the result of calling its first argument with the remaining arguments.
1 contributor
Install call as a package?
Copied
npm i @bit/justin-capalbo.ramda.call
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
call (
fn:Function,
args:...*
) : *

Returns the result of calling its first argument with the remaining arguments. This is occasionally useful as a converging function for R.converge: the first branch can produce a function while the remaining branches produce values to be passed to that function as its arguments.

Example
R.call(R.add, 1, 2); //=> 3

     const indentN = R.pipe(R.repeat(' '),
                          R.join(''),
                          R.replace(/^(?!$)/gm));

     const format = R.converge(R.call, [
                                 R.pipe(R.prop('indent'), indentN),
                                 R.prop('value')
                             ]);

     format({indent: 2, value: 'foo\nbar\nbaz\n'}); //=> '  foo\n  bar\n  baz\n'
Arguments
fn: Function

The function to apply to the remaining arguments.

args: ...*

Any number of positional arguments.

Returns
*

Help and resources