Skip to content

Instantly share code, notes, and snippets.

@agoalofalife
Created April 19, 2018 08:41
Show Gist options
  • Save agoalofalife/98860f3d23fada20f1c2a9149b11f470 to your computer and use it in GitHub Desktop.
Save agoalofalife/98860f3d23fada20f1c2a9149b11f470 to your computer and use it in GitHub Desktop.
// мощь js как функционального языка
// паттерн pipline в действие
// всего 5 строк кода
const compose = (...fns) =>
(arg) =>
fns.reduce(
(composed, f) => f(composed),
arg )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment