zustand-di
TypeScript icon, indicating that this package has built-in type declarations

0.0.14 • Public • Published

zustand-di

use react context to init zustand stores. dependency injection for zustand with react.

Build Size Version Downloads

A simplified patch of createContext from zustand/context that might be deprecated in the future. This patch removes useStoreApi.

  • This is 633 B compared to the zustand one of 831 B.
  • Opinionated: forces use of selector via typescript.

Installation

npm install zustand zustand-di

Peer Dependencies

For zustand-di@0.0.7 and higher

{
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
  "zustand": "^4.1.0"
}

For zustand-di@0.0.6 and below

{
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
  "zustand": "^4.0.0"
}

Usage

See zustand docs.

Package Sidebar

Install

npm i zustand-di

Weekly Downloads

40

Version

0.0.14

License

MIT

Unpacked Size

10.8 kB

Total Files

8

Last publish

Collaborators

  • charkour