UNPKG

zustand-ards

Version:

A library of simple opinionated utilities for zustand. zustand-ards are typesafe and designed to be easily added to an existing codebase to improve the experience of developing with zustand.

12 lines (9 loc) 530 B
import { UseBoundStoreWithEqualityFn } from 'zustand/traditional'; import { ReadonlyStoreApi } from './types.js'; import 'zustand'; /** * This enhances the traditional store hook so access to the provided store is shallow by default. * It is effectively the same as passing `shallow` from `zustand/shallow` to the original hook every time */ declare const withDefaultShallow: <T>(storeHook: UseBoundStoreWithEqualityFn<ReadonlyStoreApi<T>>) => UseBoundStoreWithEqualityFn<ReadonlyStoreApi<T>>; export { withDefaultShallow };