Socket
Socket
Sign inDemoInstall

zustand

Package Overview
Dependencies
Maintainers
3
Versions
140
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zustand - npm Package Compare versions

Comparing version 5.0.0-beta.2 to 5.0.0-rc.0

21

middleware.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc