global-react-hook
v1.1.0
Published
global hook for state and actions management
Downloads
4
Readme
What is this?
Get a state and actions management for your app
Installation
npm i global-react-hook --save
Then...
... import useStore from 'global-react-hook'
const initialState = { counter: 0 }
const actions = { add: (store, value) => { store.setState({ counter: value }) } }
const useGlobal = globalHook(initialState, actions)
function App() { const [state, actions] = useGlobal(['item'])
} ...