You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@timdeschryver What do you do when you need initialState to be TState | null? The types for this are very complex and I'm not sure what I'm missing. I've tried everything I can think of and the only thing I've gotten to work is to call createReducer with createReducer<any>([...])
Which @ngrx/* package(s) are relevant/related to the feature request?
store
Information
Possibility to create a strongly typed generic feature.
Like that:
Reproduction in the Typescript playground.
I think this is related to typescript not being able to expand conditional generic types.
I've tried doing this Issue with generic properties when type mapping and that How to test if two types are exactly the same but I haven't been able to get it to work.
This was already provided in #2982, but it's back.
Describe any alternatives/workarounds you're currently using
Casting the state to a concrete type.
Like that:
I would be willing to submit a PR to fix this issue
The text was updated successfully, but these errors were encountered: