UNPKG

301 BJavaScriptView Raw
1const mixCompose = (chain, func) => (chain instanceof Promise || typeof chain.then === "function") ? chain.then(func) : func(chain);
2
3const pipe = (...fn) => input => fn.reduce(mixCompose,input);
4const compose = (...fn) => input => fn.reduceRight(mixCompose,input);
5
6module.exports = {pipe, compose};