compose
Used for composing functions from right to left, it is a very useful utility for composing higher-order components in React, Inferno or Preact.
Packages
compose
is provided by our React, Inferno or Preact packages - refract-*
, refract-inferno-*
, refract-preact-*
.
Signature
compose
will compose multiple function to create a function which takes a single argument.
Using compose
with three functions f
, g
and h
is the equivalent of arg => f(g(h(arg)))
Example
Last updated