Skip to content

Instantly share code, notes, and snippets.

@TSMMark
Created September 9, 2021 17:07
Show Gist options
  • Save TSMMark/7624db775bf6ab6aec79e4721a613b23 to your computer and use it in GitHub Desktop.
Save TSMMark/7624db775bf6ab6aec79e4721a613b23 to your computer and use it in GitHub Desktop.
Ben Lesh's Pipe function
// 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