The type of the selected state slice.
The Zustand store instance to subscribe to.
A function that selects a piece of state from the store.
OptionalisEqual: EqualityFn<T> = shallowObjectEqualA function that compares the previous and next selector results. Should return true if they are equal and reference can be reused.
The selected state slice. Returns the previous reference if isEqual(prev, next) is true.
A React hook that wraps a Zustand store selector and preserves the previous reference if the selected value is equal to the previous one, preventing unnecessary re-renders. This is useful when the store returns a new object or array on every update, but you want to avoid infinite render loops or excessive component updates.