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
should be changed to (state !== undefined) ? state : initialState
Minimal reproduction of the problem with instructions:
Can create one if necessary...?
Version of affected browser(s),operating system(s), npm, node and ngrx:
I'm using 5.x
Other information:
As an example... in my case this feature-store represents the user session. An empty store value (undefined) means the session state is unknown (not fetched yet), a null value means no session exists and a Session object means the user is logged in. In this case the null value is being converted to undefined.
The text was updated successfully, but these errors were encountered:
Actually... should initialState be the initial state, or the default state? Is it correct that an undefined store value should always be converted to the initialState like the feature store does (in one case) today?
I'm submitting a...
What is the current behavior?
Feature store/reducers with a falsey state fallback to the initial state. This might only be for feature and not root reducers?
See
platform/modules/store/src/reducer_manager.ts
Line 46 in 7f49b9f
state || initialState
is used.Expected behavior:
Any non-undefined state value should be considered "set" and not be reset to the
initialState
.platform/modules/store/src/reducer_manager.ts
Line 46 in 7f49b9f
(state !== undefined) ? state : initialState
Minimal reproduction of the problem with instructions:
Can create one if necessary...?
Version of affected browser(s),operating system(s), npm, node and ngrx:
I'm using 5.x
Other information:
As an example... in my case this feature-store represents the user session. An empty store value (
undefined
) means the session state is unknown (not fetched yet), anull
value means no session exists and aSession
object means the user is logged in. In this case thenull
value is being converted toundefined
.The text was updated successfully, but these errors were encountered: