Created
September 9, 2021 17:07
-
-
Save TSMMark/7624db775bf6ab6aec79e4721a613b23 to your computer and use it in GitHub Desktop.
Ben Lesh's Pipe function
This file contains hidden or 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
// https://twitter.com/BenLesh/status/1435711312617746432 | |
const pipe = (start, ...fns) => fns.reduce((prev, fn) => fn(prev), start); | |
// Example usage: | |
// pipe(source, map(fn), filter(fn)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment