npm.io
1.0.0 • Published 3 years ago

global-use

Licence
ISC
Version
1.0.0
Deps
0
Size
3 kB
Vulns
0
Weekly
0

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

const initialState = { counter: 0 }

const actions = { add: (store, value) => { store.setState({ counter: value }) } }

const useGlobal = useStore(React, initialState, actions) ...