I had created a solution to scratch my itch while waiting for the pipe operator which even got a logo when it got more than a hundred stars, for anyone interested: https://github.com/egeozcan/ppipe (needs ts typings though)
pipe(2, add(2), square, n => n + 7) // -> 23
Nothing fancy but comes in handy at times.
What I really miss is something like the |> from Elixir. Maybe it's the same as F#, I don't know, but it automatically performs partial application, so that:
Enum.filter([1, 2, 3, 4], fn n -> n % 2 == 0 end)
also works like:
[1, 2, 3, 4] |> Enum.filter(fn n -> n % 2 == 0 end)
ppipe([1, 2, 3, 4]).pipe(Enum.filter, _, x => x % 2 === 0)
Not that filter fn in js is in the prototype of arrays so you'd need to extract it. There's a shortcut when using my library though: ppipe([1,2,3]).filter(x => x > 2)
I made the practical decision to provide prototype functions from the piped value while chaining.