import type { S } from '@state-designer/core'; /** * createSelectorHook * @description A function that returns a useSelector hook for the * given state. The hook works just like `useSelector`, except that * you do not need to pass the hook a state as its first argument. * @param state A state created with `createState`. * @example const useSelector = createSelectorHook(roomState) * * // In a component * const tables = useSelector((state) => state.data.tables) */ export default function createSelectorHook>(state: State): (selectFn: (update: State) => T, compareFn?: (prev: T, next: T) => boolean) => T;