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
I get tripped up forgetting to add return state to the end of my action handlers, and it's a horrible and hard to figure out issue when suddenly part or all of your state is missing.
I propose simply checking if typeof state === 'undefined' and not changing the state if it is undefined. To wipe the state, one can return null or return {} or something.
Any opinions? Concerns?
The text was updated successfully, but these errors were encountered:
I get tripped up forgetting to add
return state
to the end of my action handlers, and it's a horrible and hard to figure out issue when suddenly part or all of your state is missing.I propose simply checking if
typeof state === 'undefined'
and not changing the state if it is undefined. To wipe the state, one canreturn null
orreturn {}
or something.Any opinions? Concerns?
The text was updated successfully, but these errors were encountered: