Part of the zustand package: install zustand and import these from zustand/traditional.
Functions
useStoreWithEqualityFn
tsfunction useStoreWithEqualityFn<S extends ReadonlyStoreApi<unknown>>(
api: S,
): ExtractState<S>
function useStoreWithEqualityFn<S extends ReadonlyStoreApi<unknown>, U>(
api: S,
selector: (state: ExtractState<S>) => U,
equalityFn?: (a: U, b: U) => boolean,
): U
Constants
createWithEqualityFn
tsconst createWithEqualityFn: CreateWithEqualityFn
Types
UseBoundStoreWithEqualityFn
Also has every member of StoreApi, listed on its own entry.
tstype UseBoundStoreWithEqualityFn<S extends ReadonlyStoreApi<unknown>> = {
(): ExtractState<S>
<U>(
selector: (state: ExtractState<S>) => U,
equalityFn?: (a: U, b: U) => boolean,
): U
} & S
Was this page helpful?