Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

zustand

Package Overview
Dependencies
Maintainers
3
Versions
142
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.4 to 5.0.0-alpha.5

2

package.json
{
"name": "zustand",
"private": false,
"version": "5.0.0-alpha.4",
"version": "5.0.0-alpha.5",
"publishConfig": {

@@ -6,0 +6,0 @@ "tag": "next"

@@ -38,19 +38,9 @@ 'use strict';

var import_vanilla = require("./vanilla.ts");
const { useDebugValue, useMemo, useSyncExternalStore } = import_react.default;
const { useDebugValue, useSyncExternalStore } = import_react.default;
const identity = (arg) => arg;
const useMemoSelector = (getState, selector) => useMemo(() => {
let prev;
return () => {
const state = getState();
if (!prev || !Object.is(prev[0], state)) {
prev = [state, selector(state)];
}
return prev[1];
};
}, [getState, selector]);
function useStore(api, selector = identity) {
const slice = useSyncExternalStore(
api.subscribe,
useMemoSelector(api.getState, selector),
useMemoSelector(api.getInitialState, selector)
() => selector(api.getState()),
() => selector(api.getInitialState())
);

@@ -57,0 +47,0 @@ useDebugValue(slice);

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