o

v0.9.6arrow_drop_down
v0.9.6
STATUS
Passing
DOWNLOADS
2
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
921 B
`o` is a curried composition function that returns a unary function.
1 contributor
Install o as a package?
Copied
npm i @bit/justin-capalbo.ramda.o
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
o (
f:Function,
g:Function
) : Function

o is a curried composition function that returns a unary function. Like compose, o performs right-to-left function composition. Unlike compose, the rightmost function passed to o will be invoked with only one argument. Also, unlike compose, o is limited to accepting only 2 unary functions. The name o was chosen because of its similarity to the mathematical composition operator ∘.

Example
const classyGreeting = name => "The name's " + name.last + ", " + name.first + " " + name.last
     const yellGreeting = R.o(R.toUpper, classyGreeting);
     yellGreeting({first: 'James', last: 'Bond'}); //=> "THE NAME'S BOND, JAMES BOND"

     R.o(R.multiply(10), R.add(10))(-4) //=> 60
Arguments
f: Function
g: Function
Returns
Function

Help and resources