We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 32731fb commit 43a7b20Copy full SHA for 43a7b20
src/createPersistoid.js
@@ -102,8 +102,19 @@ export default function createPersistoid(config: PersistConfig): Persistoid {
102
}
103
})
104
105
+ let serializedState
106
+ try {
107
+ serializedState = serialize(stagedState)
108
+ } catch (err) {
109
+ console.error(
110
+ 'redux-persist/createPersistoid: error serializing state',
111
+ err
112
+ )
113
+ onWriteFail(err);
114
+ }
115
+
116
writePromise = storage
- .setItem(storageKey, serialize(stagedState))
117
+ .setItem(storageKey, serializedState)
118
.catch(onWriteFail)
119
120
0 commit comments