Last active
June 30, 2020 22:24
-
-
Save hosseinmd/cb1ee97cef16e10e1410403b4a65665d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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