1.1.0 • Published 2 years ago

react-hook-global v1.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

react-global-hook

What is this?

Get a state and actions management for your app

Installation

npm i react-global-hook --save

Then...

... import useStore from 'react-hook-global'

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')

} ...