Skip to content

Saber2pr/use-reducer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

Watchers

Forks

Releases

No releases published

Packages

No packages published