DEV Community

loading...

Discussion on: A simple explanation of functional pipe in JavaScript

Collapse
mrm8488 profile image
Manuel Romero

Real world use case: slugify a String:

const slugify = s => pipe(
toString,
toLower,
split(' '),
filter(removeDashes),
join('-')
);
Collapse
matejsvajger profile image
Matej Svajger

Very cool article!

I gave an attempt at implementing your proposal for the slugify function if anyone cares to play around: codesandbox.io/s/js-functional-pip...

Collapse
dmitriz profile image
Dmitri Zaitsev

Forgotten (s) at the end?

Collapse
mrm8488 profile image
Manuel Romero

Yes. It was like pseudo code