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

22

index.js

@@ -5,9 +5,23 @@ 'use strict';

var ReactExports = require('react');
var useSyncExternalStoreExports = require('use-sync-external-store/shim/with-selector');
var useDebugValue = ReactExports.useDebugValue;
var useSyncExternalStoreWithSelector = useSyncExternalStoreExports.useSyncExternalStoreWithSelector;
var useDebugValue = ReactExports.useDebugValue,
useMemo = ReactExports.useMemo,
useSyncExternalStore = ReactExports.useSyncExternalStore;
var identity = function identity(arg) {
return arg;
};
var useMemoSelector = function useMemoSelector(getState, selector) {
return useMemo(function () {
var lastSlice;
var lastState;
return function () {
var state = getState();
if (!Object.is(lastState, state)) {
lastSlice = selector(state);
lastState = state;
}
return lastSlice;
};
}, [getState, selector]);
};
function useStore(api, selector) {

@@ -17,3 +31,3 @@ if (selector === void 0) {

}
var slice = useSyncExternalStoreWithSelector(api.subscribe, api.getState, api.getInitialState, selector);
var slice = useSyncExternalStore(api.subscribe, useMemoSelector(api.getState, selector), useMemoSelector(api.getInitialState, selector));
useDebugValue(slice);

@@ -20,0 +34,0 @@ return slice;

2

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

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

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