Replies: 3 comments
-
Hi @diicar, Can you provide more details? What use case do you have that cannot be solved with the current implementation? |
Beta Was this translation helpful? Give feedback.
0 replies
-
I'm currently on a POC where I have a container state which contains a lot of properties.
The initial state is based on a backend service.
container.html
I hope this is more clear :) |
Beta Was this translation helpful? Give feedback.
0 replies
-
To make it work, you can add a nested state property as follows: type Stage = {
type: 'INIT';
} | {
type: 'STAGE_1';
propA: number;
propG: {};
} | {
type: 'STAGE_2';
propB: number;
propX: {};
}
const Store = signalStore(
withState({ stage: { type: 'INIT' } }),
withMethods((store) => ({
setStage(stage: Stage): void {
patchState(store, { stage });
},
})),
); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Which @ngrx/* package(s) are relevant/related to the feature request?
signals
Information
While patching the state create signals if not present.
@see : https://github.com/ngrx/platform/blob/20.0.0-beta.0/modules/signals/src/state-source.ts#L83
Thanks
Describe any alternatives/workarounds you're currently using
No response
I would be willing to submit a PR to fix this issue
Beta Was this translation helpful? Give feedback.
All reactions