Is it possible to update partial values?
Hi! Thank you for a wonderfully simple and type-safe library. 😄
I thought about this kind of things.
Currently, it seems that I can not set without passing all the properties to set, but I'd like to update the value for partially.
For example, I would like to write the following code.
interface Some {
one: string
two: string
}
interface AppStore {
some: Some
other: string
}
store.set("some")({one: "hoge"}) // <- Is this possible? Do you have plans to make it possible if you can not?
Hey @mironal! No plans to do this yet, but let’s keep this issue open in case there’s demand for it.
You might also consider using a spread as simple syntactic sugar to do this, or something like ImmutableJS to help do these deep updates.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax
https://facebook.github.io/immutable-js/
OK! Thanks for your very quick response!