Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 420 Bytes

README.md

File metadata and controls

27 lines (19 loc) · 420 Bytes

@saber2pr/use-reducer

npm i @saber2pr/use-reducer

API

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

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

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

// getState
const globalState = getState()

Author

saber2pr