Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. export const compose = (...fns) =>
  2. fns.reduce((f, g) => (...args) => f(g(...args)));
  3.  
  4. export const pipe = (...fns) => compose.apply(compose, fns.reverse());
  5.  
  6. export const apply = (fn, ...args) => (...moreArgs) => fn(...args, ...moreArgs);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement