Open matheo opened 6 days ago
I was thinking about this and don't see the benefit for now. Can you elaborate on the use case or show some examples? This also reads like 2 separate requests deep signal vs exposed context?
Deep signal would mean an API like:
this.machine.snapshot().context.someProp().someNestedProp()
vs. exposed context
this.machine.someProp()
I've got an Actor with a large set of flags/stuff in its context to be rendered in the component and the Deep Signal is a solution to access the singular data fields easily for these cases.
Yeah I guess that makes sense. Sounds like a good idea. I will look into it at some point
In the meantime I'm using my own useSelector
with a copy of toDeepSignal
from ngrx
https://github.com/ngrx/platform/pull/4533
Looking the source code of ngrx/signals they convert the object to a Deep Signal: https://github.com/ngrx/platform/blob/main/modules/signals/src/deep-signal.ts and it seems very useful to extract the context variables (only?) of an Actor.
I've spawned an Actor and assigned it into the Context and it would be nice if we can extract a Deep Signal from the child Actor context too.