Created
July 18, 2019 18:08
-
-
Save chalu/d2ee6e5bbf490b218dbcb645ba76e9d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const chain = (...fns) => { | |
return (data) => { | |
return fns.reduce((computed, fn) => { | |
return fn(computed); | |
}, data); | |
}; | |
}; | |
// use as | |
// chain(steps)(initialData) | |
// or as | |
// const algol = chain(steps); | |
// const discovery = algol(initialData); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment