Comparing version 5.0.0-beta.2 to 5.0.0-rc.0
@@ -362,6 +362,9 @@ 'use strict'; | ||
if (options.migrate) { | ||
return options.migrate( | ||
deserializedStorageValue.state, | ||
deserializedStorageValue.version | ||
); | ||
return [ | ||
true, | ||
options.migrate( | ||
deserializedStorageValue.state, | ||
deserializedStorageValue.version | ||
) | ||
]; | ||
} | ||
@@ -372,7 +375,9 @@ console.error( | ||
} else { | ||
return deserializedStorageValue.state; | ||
return [false, deserializedStorageValue.state]; | ||
} | ||
} | ||
}).then((migratedState) => { | ||
return [false, void 0]; | ||
}).then((migrationResult) => { | ||
var _a2; | ||
const [migrated, migratedState] = migrationResult; | ||
stateFromStorage = options.merge( | ||
@@ -383,3 +388,5 @@ migratedState, | ||
set(stateFromStorage, true); | ||
return setItem(); | ||
if (migrated) { | ||
return setItem(); | ||
} | ||
}).then(() => { | ||
@@ -386,0 +393,0 @@ postRehydrationCallback == null ? void 0 : postRehydrationCallback(stateFromStorage, void 0); |
@@ -6,3 +6,3 @@ { | ||
"type": "commonjs", | ||
"version": "5.0.0-beta.2", | ||
"version": "5.0.0-rc.0", | ||
"publishConfig": { | ||
@@ -9,0 +9,0 @@ "tag": "next" |
@@ -11,3 +11,7 @@ 'use strict'; | ||
const next = selector(state); | ||
return shallow.shallow(prev.current, next) ? prev.current : prev.current = next; | ||
return shallow.shallow(prev.current, next) ? prev.current : ( | ||
// It might not work with React Compiler | ||
// eslint-disable-next-line react-compiler/react-compiler | ||
prev.current = next | ||
); | ||
}; | ||
@@ -14,0 +18,0 @@ } |
<p align="center"> | ||
<img src="bear.jpg" /> | ||
<img src="docs/bear.jpg" /> | ||
</p> | ||
@@ -406,3 +406,3 @@ | ||
(prev) => ({ fishes: prev.fishes > 1 ? prev.fishes - 1 : 0 }), | ||
false, | ||
undefined, | ||
'bear/eatFish' | ||
@@ -419,3 +419,3 @@ ), | ||
(prev) => ({ fishes: prev.fishes + count }), | ||
false, | ||
undefined, | ||
{ type: 'bear/addFishes', count, } | ||
@@ -422,0 +422,0 @@ ), |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
88783
1492