Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeepSignal for Actor context #13

Open
matheo opened this issue Sep 23, 2024 · 4 comments
Open

DeepSignal for Actor context #13

matheo opened this issue Sep 23, 2024 · 4 comments

Comments

@matheo
Copy link
Contributor

matheo commented Sep 23, 2024

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.

@niklas-wortmann
Copy link
Owner

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()

@matheo
Copy link
Contributor Author

matheo commented Sep 24, 2024

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.

@niklas-wortmann
Copy link
Owner

Yeah I guess that makes sense. Sounds like a good idea. I will look into it at some point

@matheo
Copy link
Contributor Author

matheo commented Sep 24, 2024

In the meantime I'm using my own useSelector with a copy of toDeepSignal from ngrx
ngrx/platform#4533

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants