Skip to content

Instantly share code, notes, and snippets.

@hosseinmd
Last active June 30, 2020 22:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hosseinmd/cb1ee97cef16e10e1410403b4a65665d to your computer and use it in GitHub Desktop.
Save hosseinmd/cb1ee97cef16e10e1410403b4a65665d to your computer and use it in GitHub Desktop.
import { createStore, createHook } from "react-global-hook";
import actions from "../actions";
const initialState = {
counter: null
};
export const Store = createStore(
initialState,
actions,
state => {
return { ...state, counter: 0 };
}
);
export const useGlobal = createHook(Store)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment