Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

28 Commits

Repository files navigation

micro-compose

Higher-order compose function

Build StatusXO code styleGreenkeeper badge

Compose function from micro-hoofs extracted into separate npm package and a bit modified.

Install

npm install --save micro-compose
# or
yarn add micro-compose

Usage

importtestfrom'ava';importcomposefrom'./../';constfirst=fn=>(arg1,arg2)=>{returnfn(arg1,arg2,'third');};constsecond=fn=>(...args)=>{args.push('another one');returnfn(...args);};test('should compose correct',asynct=>{constcomposed=compose(first,second)(async(...args)=>{t.is(args.length,4);t.is(args[0],'first');t.is(args[1],'second');t.is(args[2],'third');t.is(args[3],'another one');});awaitcomposed('first','second');});

About

Higher-order "compose" function

Topics

Resources

Stars

24 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages