Replies: 6 comments
-
@ k3nsei, could you create a minimal and reproducible example on StackBlitz? If some investigation is required, that would help us a lot. Here's the template: https://stackblitz.com/edit/ngrx-seed |
Beta Was this translation helpful? Give feedback.
-
Provided seed was for NGRX so I created my own here as issue is related to Signal Store. https://stackblitz.com/edit/stackblitz-ng-signal-sore-9aq8nt-fvbemt?file=src%2Fmain.ts |
Beta Was this translation helpful? Give feedback.
-
@k3nsei Sorry, that's the official one https://stackblitz.com/github/ngrx/signal-store-starter?file=src%2Fmain.ts but if you have created your one own, that's fine as well. Btw. both seeders are shown when you create a new issue |
Beta Was this translation helpful? Give feedback.
-
@k3nsei I am going to move this to discussion, okay? If it turns out we have here a bug or feature request, we can create a new one. |
Beta Was this translation helpful? Give feedback.
-
Please correct me if I'm wrong. You need to dynamically initialize the state, and the initial state comes from a Service? That's why you do it in Because of that dynamic behavior, the state cannot provide the right slices? There was a similar discussion in #4341 but I'm not sure if that is the same as yours. |
Beta Was this translation helpful? Give feedback.
-
Ok, I solved my problem with a different approach. I used a mix of Here is example of my working solution https://github.com/k3nsei/ngx-signal-store-query/blob/main/libs/ngx-signal-store-query/src/with-query.ts |
Beta Was this translation helpful? Give feedback.
-
Which @ngrx/* package(s) are relevant/related to the feature request?
signals
Information
DeepSignals
are only created when defining initial state usingwithState
. When I'm usingpatchState
insideonInit
hookDeepSignal
isn't created.I want to be able to set empty object as placeholder inside state, and then in
onInit
hook replace this placeholder with result of factory function injected by dependency injection (factory fn takes reference to store as argument). Result from factory would be patched into state. I'm expecting it to beDeepSignal
, but it isn't. It's worth to note that it is typed by signal store asDeepSignal
.Real world usage could be find here: https://github.com/k3nsei/ngx-signal-store-query/blob/main/libs/ngx-signal-store-query/src/with-query.ts
So here https://github.com/k3nsei/ngx-signal-store-query/blob/1cb2edb83ddd46ed6e3017e3d75d7714d31e572e/apps/demo/src/app/app.component.ts#L49 instead of current implementation, it would be nice to be able to use something like:
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