Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@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

About

createStore & useReducer & getState.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages