Closed bmeck closed 1 month ago
I'm for 2 parameters here. Second function can be defaulted to identity
allowing to map.emplace(key, Ramda.always(42))
for just inserts. To reuse arguments you always can do it like
insertupdate = [Ramda.always(42), Ramda.add(42)];
map.emplace(key, ...insertupdate);
Of course not as eloquent as emplace(key, { insert() { return ... }, update() { return } })
but also way more compact and with less curly brackets.
@stiff What if you only want an update
action?
Good point, with { update: () => ... }
it's much simpler. Still possible with something like map.emplace(key, null, x => x + 1)
The new design is focusing on just the insert use case, so this discussion is no longer relevant.
We have various parties that disagree on weight / ergonomics of using an object for a parameter vs 2 function parameters:
CC: @waldemarhorwat , @codehag , @ljharb , @jorendorff , @erights
It would be good to get some matrix of design directions we can take without mandating a specific design. We have various things mentioned.
It would be good to clear up each of these claims and prioritize them.