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-alpha.6 to 5.0.0-beta.0

28

middleware.js

@@ -16,4 +16,3 @@ 'use strict';

const api = trackedConnections.get(name);
if (!api)
return {};
if (!api) return {};
return Object.fromEntries(

@@ -49,7 +48,2 @@ Object.entries(api.stores).map(([key, api2]) => [key, api2.getState()])

if (!extensionConnector) {
if (process.env.NODE_ENV !== "production" && enabled) {
console.warn(
"[zustand devtools middleware] Please install/enable Redux devtools extension"
);
}
return fn(set, get, api);

@@ -61,4 +55,3 @@ }

const r = set(state, replace);
if (!isRecording)
return r;
if (!isRecording) return r;
const action = nameOrAction === void 0 ? { type: anonymousActionType || "anonymous" } : typeof nameOrAction === "string" ? { type: nameOrAction } : nameOrAction;

@@ -135,3 +128,3 @@ if (store === void 0) {

`
[zustand devtools middleware] Unsupported __setState action format.
[zustand devtools middleware] Unsupported __setState action format.
When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),

@@ -151,6 +144,4 @@ and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }

}
if (!api.dispatchFromDevtools)
return;
if (typeof api.dispatch !== "function")
return;
if (!api.dispatchFromDevtools) return;
if (typeof api.dispatch !== "function") return;
api.dispatch(action);

@@ -197,4 +188,3 @@ }

const lastComputedState = (_a = nextLiftedState.computedStates.slice(-1)[0]) == null ? void 0 : _a.state;
if (!lastComputedState)
return;
if (!lastComputedState) return;
if (store === void 0) {

@@ -231,4 +221,3 @@ setStateFromDevtools(lastComputedState);

}
if (parsed !== void 0)
f(parsed);
if (parsed !== void 0) f(parsed);
};

@@ -369,4 +358,3 @@

var _a, _b;
if (!storage)
return;
if (!storage) return;
hasHydrated = false;

@@ -373,0 +361,0 @@ hydrationListeners.forEach((cb) => {

{
"name": "zustand",
"description": "🐻 Bear necessities for state management in React",
"private": false,
"version": "5.0.0-alpha.6",
"type": "commonjs",
"version": "5.0.0-beta.0",
"publishConfig": {
"tag": "next"
},
"description": "🐻 Bear necessities for state management in React",
"main": "./index.js",

@@ -81,6 +82,7 @@ "types": "./index.d.ts",

"homepage": "https://github.com/pmndrs/zustand",
"packageManager": "pnpm@8.15.0",
"peerDependencies": {
"@types/react": ">=18.0",
"@types/react": ">=18.0.0",
"immer": ">=9.0.6",
"react": ">=18.0",
"react": ">=18.0.0",
"use-sync-external-store": ">=1.2.0"

@@ -101,4 +103,3 @@ },

}
},
"packageManager": "yarn@1.22.21+sha256.dbed5b7e10c552ba0e1a545c948d5473bc6c5a28ce22a8fd27e493e3e5eb6370"
}
}

@@ -18,3 +18,3 @@ <p align="center">

```bash
npm install zustand # or yarn add zustand or pnpm add zustand
npm i zustand
```

@@ -364,2 +364,4 @@

Install the [Redux DevTools Chrome extension](https://chromewebstore.google.com/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd) to use the devtools middleware.
```jsx

@@ -366,0 +368,0 @@ import { devtools } from 'zustand/middleware'

@@ -7,4 +7,3 @@ 'use strict';

const mapB = iterableB instanceof Map ? iterableB : new Map(iterableB);
if (mapA.size !== mapB.size)
return false;
if (mapA.size !== mapB.size) return false;
for (const [key, value] of mapA) {

@@ -11,0 +10,0 @@ if (!Object.is(value, mapB.get(key))) {

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