neuro-store
Version:
18 lines (17 loc) • 442 B
TypeScript
type ReducerFn<S> = (state: S, action: any) => void;
interface CreateSliceParams<S> {
name: string;
initialState: S;
reducer: ReducerFn<S>;
}
export type ActionType<T> = {
type: string;
payload: T;
};
interface Slice<S> {
name: string;
initialState: S;
reducer: (state: S, action: any) => S;
}
export declare function createSlice<S>({ name, initialState, reducer }: CreateSliceParams<S>): Slice<S>;
export {};