compose

v0.9.6arrow_drop_down
v0.9.6
STATUS
Passing
DOWNLOADS
5
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
2 KB
Performs right-to-left function composition.
1 contributor
Install compose as a package?
Copied
npm i @bit/justin-capalbo.ramda.compose
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
compose (
null.null.null.functions:...Function
) : Function

Performs right-to-left function composition. The rightmost function may have any arity; the remaining functions must be unary.

Note: The result of compose is not automatically curried.

Example
const classyGreeting = (firstName, lastName) => "The name's " + lastName + ", " + firstName + " " + lastName
     const yellGreeting = R.compose(R.toUpper, classyGreeting);
     yellGreeting('James', 'Bond'); //=> "THE NAME'S BOND, JAMES BOND"

     R.compose(Math.abs, R.add(1), R.multiply(2))(-4) //=> 7
Argument
null.null.null.functions: ...Function

The functions to compose

Returns
Function

Help and resources