#7
in
JavaScript
#43
in
TypeScript
If you are interested in this kind of things, also have a look at fp-ts and it’s version of pipe and flow. Also comes with various monads to play around with!
This is great, thanks for sharing.
I'm currently using @arrows/composition https://caderek.github.io/arrows/packages/composition/#pipe because of the light way library approach, which you seem to share.
I also try fp-ts https://github.com/gcanti/fp-ts but is a bit an academic style, so difficult to introduce in everyday work. Implementation of pipe: https://gcanti.github.io/fp-ts/modules/function.ts.html#pipe
I still need to wrap my head on your use of generics, but yours looks more flexible than the static type approach that other libraries (include RxJS) implements, does your pipe support types for any length of arguments? Does require a specific version of TypeScript?
Nice work.
Definitely take a look at fp-ts [1]! It's mentioned at the end of the article, but I want to emphasize just how cool it is.
See https://github.com/gcanti/fp-ts. Heavily haskell-inspired and includes a TS implementation of higher-kinded types.