The initial state of the key in my reducer is undefined but after expiration it gets reset to {} which is truthy so it breaks my app, would it be possible to pass undefined or state that the element should be cleared ?
PS: You have examples using expiredState: [] but you are using Object.assign({}, config.expiredState) so anything other than an object will always return empty object, see screenshot:
PS2: Why not make expiredState a function that returns a state, so it is possible to return undefined, while still being able to just not pass the function to not have a state reset
The initial state of the key in my reducer is
undefined
but after expiration it gets reset to{}
which is truthy so it breaks my app, would it be possible to passundefined
or state that the element should be cleared ?PS: You have examples using
expiredState: []
but you are usingObject.assign({}, config.expiredState)
so anything other than an object will always return empty object, see screenshot:PS2: Why not make expiredState a function that returns a state, so it is possible to return undefined, while still being able to just not pass the function to not have a state reset