Nested Immer "produce" signals with components
I'm trying to implement something like this, which would allow me to create "nested" signals that update the upmost signal:
I'm specifically trying to avoid having to use
setCompany
in a nested component, because that would become pretty unwieldy very quickly:
However, I'm not sure how to do this.2 Replies
This seemed like createStore with produce, at first glance
I'm using Immer (and its
produce
function) to generate patches and so I can deal with reactivity on classes/nested classes.
Or, what do you mean by that?
Would you even be able to use stores with Immer? Since Immer returns a completely new object, using the store setter to set the object would mean you won't get the fine-grained reactivity, right?
If you mean something like:
I don't think that would work with the patch generation, since it would just make the patches relative to .some.path
and you couldn't just put that into a undo/redo context.
Is it even possible to do this reactively?