Verify that localStorage doesn't have your key:value (bug)
Dispatch an action
Verify that localStorage has your key:value (expected)
Observed behavior
Initial page load doesn't create an initial state in localStorage.
Desired behavior
// storage.plugin.ts
if (isInitAction) {
for (const key of keys) {
let val = this._engine.getItem(key);
if (val !== 'undefined' && val !== null) {
val = options.deserialize(val);
if (key !== '@@STATE') {
state = setValue(state, key, val);
} else {
state = val;
}
} else {
this._engine.setItem(key, options.serialize(state)); // <- here (possible solution)
}
}
}
[x] Bug
Versions
Repro steps
Observed behavior
Initial page load doesn't create an initial state in localStorage.
Desired behavior