Skip to content

Instantly share code, notes, and snippets.

@LucGranato
Created September 16, 2019 16:53
Show Gist options
  • Save LucGranato/a628f04aa59cf3c3878a995039d2b3f3 to your computer and use it in GitHub Desktop.
Save LucGranato/a628f04aa59cf3c3878a995039d2b3f3 to your computer and use it in GitHub Desktop.
Promise pipe
'use string';
module.exports = (...functions) => input => functions.reduce((chain, func) => chain.then(func), Promise.resolve(input));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment