Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages