Re:A generically typed pipe function in TypeScript
by reeeeee on Monday August 08, 2022 @04:23AM
(#32383404)
If you extract this `Chain` class to a separate package, I would gladly reuse it in my applications. I've been thinking about creating a `Vavr`[0] clone in typescript, as I really like the syntax used in that library, especially the `Try` construct.
Re:A generically typed pipe function in TypeScript
by jhardy54 on Sunday August 07, 2022 @11:55PM
(#32382270)
This works great for small datasets, but often you’ll have to eventually use streams rather than arrays. I’ve used pull-stream to do this in the past.
Re:A generically typed pipe function in TypeScript
by andreareina on Monday August 08, 2022 @12:26AM
(#32382387)
.use is a nice quality of life feature!
I made a similar data structure[1] to allow adding side effect (no return value) as part of the chained function.
[1] https://github.com/beenotung/tslib/blob/9f9a9274c1e13be7ba83...