useSimpleStateValue
Overview
Type: Function
A React hook to consume a SimpleStateManager
.
const state = useSimpleStateValue(stateManager)
Overloads (+2)
const state = useSimpleStateValue(stateManager, selector)
const state = useSimpleStateValue(stateManager, selector, active)
Parameters
stateManager
— The State Manager to watch for changes.
Type:SimpleStateManager
Required: Yesselector
— A function that accepts the state as an argument and returns a derived value. This function does not need to be declared outside of the component function body or wrapped inuseCallback
.
Type:StateSelector
Required: No — (default value:null
)active
— Controls whether the hook should watch for state changes and trigger component update.
Type:boolean
Required: No — (default value:true
)