That's great! Took a cursory look at the code, and if you'd reversed the argument order, you could've delegated to pipe (maybe a more familiar name for people?) and compose (right-associative version of pipe) from lodash, ramda or whatever. The problem now is, what if I'm already piping a bunch of unary functions using any of the bigger FP toolbelts, and add a immutadot function? It won't work:
I gotta say, data-first & lack of auto-currying really hurts their API. Consider:
If I want to change my current city, as well as push a new one onto the list of cities, I have to do this:
Nothing here is reusable or composable. If the methods had taken their data last, and have been curried, we could've had both:
Which could be abstract out into:
Good API inspiration,
monocle-ts
: github.com/gcanti/monocle-tsHi Steven!
Actually our API has a way to do this:
Here's your working example on runkit: runkit.com/embed/kr9e9tins87j
Anyway thank you for your comment, we're waiting for other constructive feedback from you.
That's great! Took a cursory look at the code, and if you'd reversed the argument order, you could've delegated to
pipe
(maybe a more familiar name for people?) andcompose
(right-associative version of pipe) fromlodash
,ramda
or whatever. The problem now is, what if I'm already piping a bunch of unary functions using any of the bigger FP toolbelts, and add aimmutadot
function? It won't work: