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

zustand

Package Overview
Dependencies
Maintainers
1
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 0.0.4 to 0.0.5

.babelrc

12

.size-snapshot.json
{
"dist/index.js": {
"bundled": 1904,
"minified": 852,
"gzipped": 408,
"bundled": 1877,
"minified": 829,
"gzipped": 394,
"treeshaked": {

@@ -17,6 +17,6 @@ "rollup": {

"dist/index.cjs.js": {
"bundled": 2692,
"minified": 1207,
"gzipped": 482
"bundled": 2665,
"minified": 1184,
"gzipped": 469
}
}

@@ -39,3 +39,3 @@ 'use strict';

if (sliceRef.current !== selected && typeof selected === 'object' && !Array.isArray(selected)) {
if (sliceRef.current !== selected && selected === Object(selected)) {
selected = Object.entries(selected).reduce(function (acc, _ref) {

@@ -42,0 +42,0 @@ var _Object$assign;

@@ -24,3 +24,3 @@ import React from 'react';

if (sliceRef.current !== selected && typeof selected === 'object' && !Array.isArray(selected)) {
if (sliceRef.current !== selected && selected === Object(selected)) {
selected = Object.entries(selected).reduce((acc, [key, value]) => sliceRef.current[key] !== value ? Object.assign({}, acc, {

@@ -27,0 +27,0 @@ [key]: value

{
"name": "zustand",
"version": "0.0.4",
"version": "0.0.5",
"description": "🐻 Bear necessities for state management in React",

@@ -12,3 +12,5 @@ "main": "dist/index.cjs.js",

"prepare": "npm run build",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "jest",
"test:dev": "jest --watch --no-coverage",
"test:coverage:watch": "jest --watch"
},

@@ -52,2 +54,25 @@ "husky": {

"homepage": "https://github.com/drcmda/zustand#readme",
"jest": {
"testPathIgnorePatterns": [
"/node_modules/",
"jest",
"legacy"
],
"testRegex": "test.(js|ts|tsx)$",
"coverageDirectory": "./coverage/",
"collectCoverage": true,
"coverageReporters": [
"json",
"html",
"text",
"text-summary"
],
"collectCoverageFrom": [
"src/**/*.js",
"tests/**/*.js"
],
"setupFilesAfterEnv": [
"<rootDir>/setupTests.js"
]
},
"devDependencies": {

@@ -62,5 +87,11 @@ "@babel/core": "7.3.4",

"@babel/preset-typescript": "^7.3.3",
"enzyme": "^3.9.0",
"enzyme-adapter-react-16": "^1.12.1",
"husky": "^1.3.1",
"jest": "^24.7.1",
"lint-staged": "^8.1.5",
"prettier": "^1.16.4",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-testing-library": "^6.1.2",
"rimraf": "^2.6.3",

@@ -67,0 +98,0 @@ "rollup": "^1.9.0",

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

Small, fast and scaleable bearbones state-management solution. Has a comfy api based on hooks, isn't that boilerplatey or opinionated, but still just enough to be explicit and flux-like, breaches reconciler boundaries. You can check out a small live demo [here](https://codesandbox.io/s/v8pjv251w7).
Small, fast and scaleable bearbones state-management solution. Has a comfy api based on hooks, isn't that boilerplatey or opinionated, but still just enough to be explicit and flux-like, breaches reconciler boundaries and is cross-platform to boot. Make your paws dirty with a small live demo [here](https://codesandbox.io/s/v8pjv251w7).

@@ -121,3 +121,3 @@ #### Create a store (or multiple, up to you...)

Having to construct nested structes bearhanded is one of the worst aspects of reducing state. Try [immer](https://github.com/mweststrate/immer)! It is a tiny package that allows you to work with immutable state in a more convenient way. You can easily extend your store with it.
Having to build nested structures bearhanded is one of the more tiresome aspects of reducing state. Have you tried [immer](https://github.com/mweststrate/immer)? It is a tiny package that allows you to work with immutable state in a more convenient way. You can easily extend your store with it.

@@ -163,1 +163,17 @@ ```jsx

```
## Middleware
```jsx
const logger = fn => {
return (set, get) => fn(args => {
console.log(" applying", args)
set(args)
console.log(" new state", get())
}, get)
}
const [useStore] = create(logger((set, get) => {
return { text: "hello", setText: text => set({ text }) }
}))
```

@@ -47,2 +47,2 @@ import path from 'path'

export default [...createConfig('index', 'index')]
export default [...createConfig('src/index', 'index')]

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