@saber2pr/use-reducer

0.0.3 • Public • Published

@saber2pr/use-reducer

npm i @saber2pr/use-reducer

API

export const initState = {
  current: 100,
  delta: 1
}

export const [getState, useReducer] = createStore(state)

// useReducer
const [state, dispatch] = useReducer(reducer, initialState)
// const [state, dispatch] = useReducer(reducer, initialState, initialAction)

// getState
const globalState = getState()

Author

saber2pr

Package Sidebar

Install

npm i @saber2pr/use-reducer

Weekly Downloads

0

Version

0.0.3

License

ISC

Unpacked Size

3.25 kB

Total Files

6

Last publish

Collaborators

  • saber2pr