Release v1.2.1
Patch Changes
-
fab33c4: - ✨ Support for Zustand-style slice composition via
SliceCreatorutility type.- Now you can structure your store in a modular, scalable way by composing smaller slices and combining them into a single store.
export type SliceCreator<TStore extends BaseType, TSlice = Partial<TStore>> = ( set: StateSetter<TStore>, get: () => TStore | null, ) => TSlice;
Usage
const useKosha = create<StoreType>((...a) => ({ ...createThemeSlice(...a), ...counterSlice(...a), }));
Full Changelog: 1.2.0...1.2.1