Doesn't this need a PIPE function to chain ops?
In Ramda, for instance, we have a pipe func to enable chaining operations on collections etc. Seems quite a boon it would be to have it here in LO --
@effinsky I thought about the same thing!
I just did a draft implementation of what I thought that a Compose and a Pipe functions would look like. You can see it here if you'd like: https://github.com/GCrispino/lo/blob/compose/func.go#L43
These functions receive just two functions as arguments, which is not exactly what happens in their counterparts in Ramda/Lodash, where you can pass a variadic number of functions. I think this couldn't be replicated in Golang in a type safe way, but something like the PartialN functions and create ComposeN and PipeN functions.
If this sounds interesting to the maintainer I'd be happy to create a pull request with these changes.
This would be nice, since at the moment things can get really cumbersome with needless intermediate variables for collections etc between outputs that should naturally flow into further ops as inputs.
@effinsky FYI, went ahead and created #325 to address this 👍🏼
Thanks for the proposal.
We added support for Go iterators in lo >= 1.52. I also implemented a dedicated Go package for reactive programming: https://github.com/samber/ro
Further discussion will take place there.