1.1.18 • Published 10 months ago

create-zustand-store-context v1.1.18

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

create-zustand-store-context

AbortController hook

NPM JavaScript Style Guide

Install

npm install --save create-zustand-store-context

Usage

import { createZustandStoreContext } from "create-zustand-store-context";

type Store = {
  value: boolean;
};

const initialState: Store = {
  value: false,
};

const { storeContext, useState, useStore } =
  createZustandStoreContext<Store>(initialState);

const StoreContext = storeContext;

function Provider({ children }: WithChildren) {
  const currentStore = useStore();

  return (
    <StoreContext.Provider value={currentStore}>
      {children}
    </StoreContext.Provider>
  );
}

export { Provider, useState };

License

MIT © marcoSven

1.1.18

10 months ago

1.1.17

10 months ago

1.1.21

10 months ago

1.1.16

10 months ago

1.1.15

10 months ago

1.1.2

10 months ago

1.1.12

1 year ago

1.1.11

1 year ago

1.1.0

1 year ago