useStateDesigner
const useSelector = createSelectorHook(state)
This is a helper that will generate a selector hook from a state. Unlike the library’s regular useSelector
hook, the hook returned by createSelectorHook
does not require you to provide the state as a first argument.
import { createState, createSelectorHook } from '@state-designer/react'const state = createState({ ... })const useSelector = createSelectorHook(state)
See the useSelector
article for more on how to use selectors.