thunkify

v0.9.6arrow_drop_down
v0.9.6
STATUS
Passing
DOWNLOADS
2
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
1 KB
Creates a thunk out of a function.
1 contributor
Install thunkify as a package?
Copied
npm i @bit/justin-capalbo.ramda.thunkify
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
thunkify (
fn:Function
) : Function

Creates a thunk out of a function. A thunk delays a calculation until its result is needed, providing lazy evaluation of arguments.

Example
R.thunkify(R.identity)(42)(); //=> 42
     R.thunkify((a, b) => a + b)(25, 17)(); //=> 42
Argument
fn: Function

A function to wrap in a thunk

Returns
Function

Expects arguments for `fn` and returns a new function that, when called, applies those arguments to `fn`.

Help and resources