{"_id":"@bad-hacking/zustand","_rev":"7-1e994afbaf6fd8719366d9da42c679a2","name":"@bad-hacking/zustand","dist-tags":{"latest":"0.0.9"},"versions":{"0.0.2":{"name":"@bad-hacking/zustand","version":"0.0.2","_id":"@bad-hacking/zustand@0.0.2","maintainers":[{"name":"ehyland","email":"ehyland90@gmail.com"}],"dist":{"shasum":"1f6e290e3a5f99c0858ae53212c77a59c0f1c815","tarball":"https://registry.npmjs.org/@bad-hacking/zustand/-/zustand-0.0.2.tgz","fileCount":5,"integrity":"sha512-RTsoeFTd54b0GLL5LeW/rL6onwPyshuQ4hEkWXzod8WPzobNR6SV0QWaGN3OyxeABhkUwOsi4okWQxorOtj1RA==","signatures":[{"sig":"MEUCIEm0OBoGUgv2Kj5VNCpmS1RF9QJnGV68XPPYPqdS8NOiAiEA/jMYjuJDL1vDPifVWiHEqxptROuHqBlwKnoO4RIqKtM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13858},"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"17ae2cf0abdcf89af8d41df329366bdfaf89f00f","scripts":{"dev":"tsup --watch","lint":"biome check","test":"vitest","build":"tsup","check":"pnpm run '/^(typecheck|lint|format|test:ci)$/'","format":"prettier --check .","test:ci":"CI=true vitest","typecheck":"tsc"},"_npmUser":{"name":"ehyland","email":"ehyland90@gmail.com"},"_npmVersion":"10.8.0","description":"Helper library that makes working with zustand easier","directories":{},"_nodeVersion":"20.16.0","dependencies":{"immer":"^10.1.1","zustand":"^4.5.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@9.7.0","devDependencies":{"tsup":"^8.2.4","jsdom":"^24.1.1","react":"^18.3.1","vitest":"^2.0.5","prettier":"^3.3.3","react-dom":"^18.3.1","typescript":"^5.5.4","@types/node":"^22.2.0","@types/react":"^18.3.4","@biomejs/biome":"^1.8.3","@types/react-dom":"^18.3.0","@testing-library/dom":"^10.4.0","@testing-library/react":"^16.0.0","@testing-library/jest-dom":"^6.4.8","@testing-library/user-event":"^14.5.2"},"_npmOperationalInternal":{"tmp":"tmp/zustand_0.0.2_1724635171206_0.2894956296522664","host":"s3://npm-registry-packages"}},"0.0.3":{"name":"@bad-hacking/zustand","version":"0.0.3","_id":"@bad-hacking/zustand@0.0.3","maintainers":[{"name":"ehyland","email":"ehyland90@gmail.com"}],"dist":{"shasum":"6f87c4534bb98c7995a8c5d4b0c51e0b4051b390","tarball":"https://registry.npmjs.org/@bad-hacking/zustand/-/zustand-0.0.3.tgz","fileCount":5,"integrity":"sha512-9kEQC4lCNFnh0Y0Gfc/6QWrFp7PMTPH02YOiAZz3c/xX7IwuUFKtqijywVDrJgL3+N5nVQTXUkFHhj4G7QKPxw==","signatures":[{"sig":"MEUCIDFMDfC+fQgsNLTLS6iCwxJ2l1hol2QVAJUWF8penuVmAiEAgc0y465deGFb8grgHztiHbbtdInimoNYeZll7C2jkM4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13878},"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"6abef0a9538e96a8765bbaab51f4ff63bf087755","scripts":{"dev":"tsup --watch","lint":"biome check","test":"vitest","build":"tsup","check":"pnpm run '/^(typecheck|lint|format|test:ci)$/'","format":"prettier --check .","test:ci":"CI=true vitest","typecheck":"tsc"},"_npmUser":{"name":"ehyland","email":"ehyland90@gmail.com"},"_npmVersion":"10.8.0","description":"Helper library that makes working with zustand easier","directories":{},"_nodeVersion":"20.16.0","dependencies":{"immer":"^10.1.1","zustand":"^4.5.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@9.7.0","devDependencies":{"tsup":"^8.2.4","jsdom":"^24.1.1","react":"^18.3.1","vitest":"^2.0.5","prettier":"^3.3.3","react-dom":"^18.3.1","typescript":"^5.5.4","@types/node":"^22.2.0","@types/react":"^18.3.4","@biomejs/biome":"^1.8.3","@types/react-dom":"^18.3.0","@testing-library/dom":"^10.4.0","@testing-library/react":"^16.0.0","@testing-library/jest-dom":"^6.4.8","@testing-library/user-event":"^14.5.2"},"_npmOperationalInternal":{"tmp":"tmp/zustand_0.0.3_1724661900916_0.5176799111390447","host":"s3://npm-registry-packages"}},"0.0.4":{"name":"@bad-hacking/zustand","version":"0.0.4","_id":"@bad-hacking/zustand@0.0.4","maintainers":[{"name":"ehyland","email":"ehyland90@gmail.com"}],"dist":{"shasum":"5e7a56906541c782ffcafb607fb207f251189901","tarball":"https://registry.npmjs.org/@bad-hacking/zustand/-/zustand-0.0.4.tgz","fileCount":5,"integrity":"sha512-aZeala01+A+lE5r+FjfywBD10eut97NN7BQ/HY/of6F3m/R0P76CwmCKLmXH/NwoB+ViQjguKi70LbVyU7EfaA==","signatures":[{"sig":"MEYCIQCLOoPWaS4fJwhst2B125Ljg/2Y4w6SR7Oxvm286524eAIhALwb3ae9/q4PQa6IQraiS7rwnvMC3p/mttHwqNoSWjLZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13878},"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"6abef0a9538e96a8765bbaab51f4ff63bf087755","scripts":{"dev":"tsup --watch","lint":"biome check","test":"vitest","build":"tsup","check":"pnpm run '/^(typecheck|lint|format|test:ci)$/'","format":"prettier --check .","test:ci":"CI=true vitest","typecheck":"tsc"},"_npmUser":{"name":"ehyland","email":"ehyland90@gmail.com"},"_npmVersion":"10.8.0","description":"Helper library that makes working with zustand easier","directories":{},"_nodeVersion":"20.16.0","dependencies":{"immer":"^10.1.1","zustand":"^4.5.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@9.7.0","devDependencies":{"tsup":"^8.2.4","jsdom":"^24.1.1","react":"^18.3.1","vitest":"^2.0.5","prettier":"^3.3.3","react-dom":"^18.3.1","typescript":"^5.5.4","@types/node":"^22.2.0","@types/react":"^18.3.4","@biomejs/biome":"^1.8.3","@types/react-dom":"^18.3.0","@testing-library/dom":"^10.4.0","@testing-library/react":"^16.0.0","@testing-library/jest-dom":"^6.4.8","@testing-library/user-event":"^14.5.2"},"_npmOperationalInternal":{"tmp":"tmp/zustand_0.0.4_1724661932595_0.2490708025447752","host":"s3://npm-registry-packages"}},"0.0.5":{"name":"@bad-hacking/zustand","version":"0.0.5","_id":"@bad-hacking/zustand@0.0.5","maintainers":[{"name":"ehyland","email":"ehyland90@gmail.com"}],"dist":{"shasum":"9d172db45a8e2613bd38a67ba262afbaf61cfc04","tarball":"https://registry.npmjs.org/@bad-hacking/zustand/-/zustand-0.0.5.tgz","fileCount":5,"integrity":"sha512-BkwfNSDUz+9408+0VfVBxRQHylv016u3Fmjk3PjfDYPsWZ5DocfqPAwzWHWlDfu8tVMy0Wwc+P+GgR5X8RjJOA==","signatures":[{"sig":"MEUCIGHz9Y1QoJoxf/oROthR+iRqUyblnfhqAroO8uUnA0F5AiEAzNWwphVdXx3lhHkVGvYVND5S08PN1+SU7RbRtCeaGhc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":14011},"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"6abef0a9538e96a8765bbaab51f4ff63bf087755","scripts":{"dev":"tsup --watch","lint":"biome check","test":"vitest","build":"tsup","check":"pnpm run '/^(typecheck|lint|format|test:ci)$/'","format":"prettier --check .","test:ci":"CI=true vitest","typecheck":"tsc"},"_npmUser":{"name":"ehyland","email":"ehyland90@gmail.com"},"_npmVersion":"10.8.0","description":"Helper library that makes working with zustand easier","directories":{},"_nodeVersion":"20.16.0","dependencies":{"immer":"^10.1.1","zustand":"^4.5.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@9.7.0","devDependencies":{"tsup":"^8.2.4","jsdom":"^24.1.1","react":"^18.3.1","vitest":"^2.0.5","prettier":"^3.3.3","react-dom":"^18.3.1","typescript":"^5.5.4","@types/node":"^22.2.0","@types/react":"^18.3.4","@biomejs/biome":"^1.8.3","@types/react-dom":"^18.3.0","@testing-library/dom":"^10.4.0","@testing-library/react":"^16.0.0","@testing-library/jest-dom":"^6.4.8","@testing-library/user-event":"^14.5.2"},"_npmOperationalInternal":{"tmp":"tmp/zustand_0.0.5_1724662059495_0.41677903447432296","host":"s3://npm-registry-packages"}},"0.0.6":{"name":"@bad-hacking/zustand","version":"0.0.6","_id":"@bad-hacking/zustand@0.0.6","maintainers":[{"name":"ehyland","email":"ehyland90@gmail.com"}],"dist":{"shasum":"9fd656f7aa5558fefe2e1210ea11956791bf3ff8","tarball":"https://registry.npmjs.org/@bad-hacking/zustand/-/zustand-0.0.6.tgz","fileCount":5,"integrity":"sha512-ESGEeHl2X2rlWDv+6OYqTMHffVtnWHVzjqPQv8g6I+TSADnPEIOs+aIsnWNk2xKecWU/CwLD1nnhgFrbunUVBg==","signatures":[{"sig":"MEUCIQCV7I07+U79fxPVJYILXz3nLrrueR6VVk+goo1zu45MWgIgbuRmKvSSDMBUTjt1ARGLbQi7n2IZrvSc956f4hie7bI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":14265},"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"5f0159640c8bb9e05dd710a031a0ec23ad0ec508","scripts":{"dev":"tsup --watch","lint":"biome check","test":"vitest","build":"tsup","check":"pnpm run '/^(typecheck|lint|format|test:ci)$/'","format":"prettier --check .","test:ci":"CI=true vitest","typecheck":"tsc"},"_npmUser":{"name":"ehyland","email":"ehyland90@gmail.com"},"_npmVersion":"10.8.0","description":"Helper library that makes working with zustand easier","directories":{},"_nodeVersion":"20.16.0","dependencies":{"immer":"^10.1.1","zustand":"^4.5.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@9.7.0","devDependencies":{"tsup":"^8.2.4","jsdom":"^24.1.1","react":"^18.3.1","vitest":"^2.0.5","prettier":"^3.3.3","react-dom":"^18.3.1","typescript":"^5.5.4","@types/node":"^22.2.0","@types/react":"^18.3.4","@biomejs/biome":"^1.8.3","@types/react-dom":"^18.3.0","@testing-library/dom":"^10.4.0","@testing-library/react":"^16.0.0","@testing-library/jest-dom":"^6.4.8","@testing-library/user-event":"^14.5.2"},"_npmOperationalInternal":{"tmp":"tmp/zustand_0.0.6_1725347943807_0.6690243040707","host":"s3://npm-registry-packages"}},"0.0.7":{"name":"@bad-hacking/zustand","version":"0.0.7","_id":"@bad-hacking/zustand@0.0.7","maintainers":[{"name":"ehyland","email":"ehyland90@gmail.com"}],"dist":{"shasum":"244a2d3dc41e72cb8e37f1ba049f65cdcf07b15a","tarball":"https://registry.npmjs.org/@bad-hacking/zustand/-/zustand-0.0.7.tgz","fileCount":5,"integrity":"sha512-EjHtgAIJhHkE+9nnIDjaa3kUsMbku/lRHSH2CKDDgacUx9e5oBrRMmvIwFmPGpBAEzph08uvADNSlXO+BSFk6A==","signatures":[{"sig":"MEUCIG5LDYXyemX09AkJkN3UFQcMFnvbBIy2Yn3ymX7bVxsmAiEAsp5UvSWfw5+3pmRPAbDkvDLYXkZv3qTdL7EVsExwk/g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":14539},"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"7a97867449329db4fd6e0925db9dd3ba9a7b32f8","scripts":{"dev":"tsup --watch","lint":"biome check","test":"vitest","build":"tsup","check":"pnpm run '/^(typecheck|lint|format|test:ci)$/'","format":"prettier --check .","test:ci":"CI=true vitest","typecheck":"tsc"},"_npmUser":{"name":"ehyland","email":"ehyland90@gmail.com"},"_npmVersion":"10.8.0","description":"Helper library that makes working with zustand easier","directories":{},"_nodeVersion":"20.16.0","dependencies":{"immer":"^10.1.1","zustand":"^4.5.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@9.7.0","devDependencies":{"tsup":"^8.2.4","jsdom":"^24.1.1","react":"^18.3.1","vitest":"^2.0.5","prettier":"^3.3.3","react-dom":"^18.3.1","typescript":"^5.5.4","@types/node":"^22.2.0","@types/react":"^18.3.4","@biomejs/biome":"^1.8.3","@types/react-dom":"^18.3.0","@testing-library/dom":"^10.4.0","@testing-library/react":"^16.0.0","@testing-library/jest-dom":"^6.4.8","@testing-library/user-event":"^14.5.2"},"_npmOperationalInternal":{"tmp":"tmp/zustand_0.0.7_1728087962423_0.4685072481465662","host":"s3://npm-registry-packages"}},"0.0.8":{"name":"@bad-hacking/zustand","version":"0.0.8","_id":"@bad-hacking/zustand@0.0.8","maintainers":[{"name":"ehyland","email":"ehyland90@gmail.com"}],"dist":{"shasum":"e041a70a501b50a783847bda8c61688d83a98f71","tarball":"https://registry.npmjs.org/@bad-hacking/zustand/-/zustand-0.0.8.tgz","fileCount":5,"integrity":"sha512-r4YX9EPOxOcAjpVHec/N0zH40v5kP2Nz2LplMjlbceZMfd8Q4L7eRlQDfuB/T/tEzPHTFNqA3FdtnRQop0Gm0Q==","signatures":[{"sig":"MEUCIBc2B91zb4ZhA4tldUsGKz3cRvIi6aKt+2gGGEzPAcHZAiEAxbmv0NDPyc61SyQ1ybvwKWpCPusjtUtaLpByJfArSs0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":14669},"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"828efe5d5318d5228664b1c0ddc3b7ce352820e4","scripts":{"dev":"tsup --watch","lint":"biome check","test":"vitest","build":"tsup","check":"pnpm run '/^(typecheck|lint|format|test:ci)$/'","format":"prettier --check .","test:ci":"CI=true vitest","typecheck":"tsc"},"_npmUser":{"name":"ehyland","email":"ehyland90@gmail.com"},"_npmVersion":"10.8.0","description":"Helper library that makes working with zustand easier","directories":{},"_nodeVersion":"20.16.0","dependencies":{"immer":"^10.1.1","zustand":"^4.5.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@9.7.0","devDependencies":{"tsup":"^8.2.4","jsdom":"^24.1.1","react":"^18.3.1","vitest":"^2.0.5","prettier":"^3.3.3","react-dom":"^18.3.1","typescript":"^5.5.4","@types/node":"^22.2.0","@types/react":"^18.3.4","@biomejs/biome":"^1.8.3","@types/react-dom":"^18.3.0","@testing-library/dom":"^10.4.0","@testing-library/react":"^16.0.0","@testing-library/jest-dom":"^6.4.8","@testing-library/user-event":"^14.5.2"},"_npmOperationalInternal":{"tmp":"tmp/zustand_0.0.8_1728088007806_0.29295031761221346","host":"s3://npm-registry-packages"}},"0.0.9":{"name":"@bad-hacking/zustand","version":"0.0.9","type":"module","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}},"publishConfig":{"access":"public"},"packageManager":"pnpm@9.7.0","scripts":{"dev":"tsup --watch","build":"tsup","test":"vitest","test:ci":"CI=true vitest","format":"prettier --check .","lint":"biome check","typecheck":"tsc","check":"pnpm run '/^(typecheck|lint|format|test:ci)$/'"},"devDependencies":{"@biomejs/biome":"^1.8.3","@testing-library/dom":"^10.4.0","@testing-library/jest-dom":"^6.4.8","@testing-library/react":"^16.0.0","@testing-library/user-event":"^14.5.2","@types/node":"^22.2.0","@types/react":"^18.3.4","@types/react-dom":"^18.3.0","jsdom":"^24.1.1","prettier":"^3.3.3","react":"^18.3.1","react-dom":"^18.3.1","tsup":"^8.2.4","typescript":"^5.5.4","vitest":"^2.0.5"},"dependencies":{"immer":"^10.1.1","zustand":"^4.5.5"},"_id":"@bad-hacking/zustand@0.0.9","gitHead":"69c4200e38647396434285698ce05f68119aa7ad","description":"Helper library that makes working with zustand easier","_nodeVersion":"20.16.0","_npmVersion":"10.8.0","dist":{"integrity":"sha512-H/H2se1nIAYCJH8b09kMvK8gsjgphFEVFTJIcDhRTfsKxsSe+JmW/AUWZfbOo412tyl5N6ydz/qu8WKsrXZd1w==","shasum":"82fced90bff823c39caa85c1adb85e32822544eb","tarball":"https://registry.npmjs.org/@bad-hacking/zustand/-/zustand-0.0.9.tgz","fileCount":5,"unpackedSize":15347,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFINidNVuFhVBNTbNsJOKNqIVuBATYlS9dKEkfANz5SOAiAxzhuVa/h3ZlPJiGgOTGvpv04VHTgv1qKab2odzHtlNA=="}]},"_npmUser":{"name":"ehyland","email":"ehyland90@gmail.com"},"directories":{},"maintainers":[{"name":"ehyland","email":"ehyland90@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/zustand_0.0.9_1728258563842_0.859751699429937"},"_hasShrinkwrap":false}},"time":{"created":"2024-08-26T01:19:31.082Z","modified":"2024-10-06T23:49:24.234Z","0.0.2":"2024-08-26T01:19:31.448Z","0.0.3":"2024-08-26T08:45:01.065Z","0.0.4":"2024-08-26T08:45:32.743Z","0.0.5":"2024-08-26T08:47:39.628Z","0.0.6":"2024-09-03T07:19:03.991Z","0.0.7":"2024-10-05T00:26:02.606Z","0.0.8":"2024-10-05T00:26:48.021Z","0.0.9":"2024-10-06T23:49:24.004Z"},"description":"Helper library that makes working with zustand easier","maintainers":[{"name":"ehyland","email":"ehyland90@gmail.com"}],"readme":"# Zustand Tools\n\nHelper library that makes working with zustand easier\n\n✨ Separate actions from state\n\n✨ Automatically create bound react hooks & providers\n\n✨ Immer integration with `store.update(fn)`\n\n✨ Better TypeScript experience\n\n## Examples\n\n### Example: TicTacToe Game\n\n```tsx\nimport { createReactHooks, type ActionDefinitions } from '@bad-hacking/zustand';\n\ntype PlayerKey = 'x' | 'o';\n\ntype PositionState = PlayerKey | undefined;\n\ntype BoardState = [\n  [PositionState, PositionState, PositionState],\n  [PositionState, PositionState, PositionState],\n  [PositionState, PositionState, PositionState],\n];\n\ntype State = {\n  nextPlayer: PlayerKey;\n  board: BoardState;\n};\n\ntype Actions = typeof actions;\n\nconst actions = {\n  markPosition: (store, x: number, y: number) => {\n    store.update((draft) => {\n      draft.board[y][x] = draft.nextPlayer;\n      draft.nextPlayer = draft.nextPlayer === 'x' ? 'o' : 'x';\n    });\n  },\n} satisfies ActionDefinitions<State>;\n\nconst selectWinner = (state: State) => {\n  /* find a winning line */\n};\n\nconst { StoreProvider, useActions, useSelector, useStore } = createReactHooks<\n  State,\n  Actions\n>(actions);\n\nexport const App = () => {\n  return (\n    <StoreProvider\n      initialState={{\n        nextPlayer: 'x',\n        board: [\n          [undefined, undefined, undefined],\n          [undefined, undefined, undefined],\n          [undefined, undefined, undefined],\n        ],\n      }}\n    >\n      <TicTacToe />\n    </StoreProvider>\n  );\n};\n\nexport const TicTacToe = () => {\n  const actions = useActions();\n  const winner = useSelector(selectWinner);\n  const board = useSelector((state) => state.board);\n  return (\n    <div>\n      {winner && <div>And the winner is {winner.marker}</div>}\n      {board.map((row, y) =>\n        row.map((status, x) => (\n          <button\n            key={`${x},${y}`}\n            type=\"button\"\n            onClick={() => actions.markPosition(x, y)}\n          >\n            {status}\n          </button>\n        )),\n      )}\n    </div>\n  );\n};\n```\n","readmeFilename":"README.md"}