Closed English3000 closed 5 years ago
I actually just started using Undux. So for now, ergonomics!
But I'll let you know if I come across another :wink:
I guess you'd recommend reading multiple values via getState/1
.
What about for writing multiple values at once, like one can with React's setState/1
?
@English3000 Sorry for the delayed response. I recommend you stick to .get
and .set
. Avoid .getState
when possible.
Hey,
My use case is when I want to get multiple values from the store--I'd prefer not to have to call
store.get/1
multiple times.getState/1
does allow for that.There's also the "write" version of that use case: setting multiple key-value pairs in one function call, by passing an object and then merging.
I'm no expert in TypeScript, so I just added the raw code.
LMK WYT, Alexander