UNPKG

rtk-slice-manager

Version:

Wrap over slice from @reduxjs/toolkit for automatic generation of actions and isolation of effect logic after changing the state of the fields

16 lines (15 loc) 782 B
import { PayloadAction } from "@reduxjs/toolkit"; import { Deps, ManagerReducers } from "./types"; export declare const capitalize: (str: string) => string; export declare const decapitalize: <T extends string>(str: T) => T; export declare function getDeepKeys<T>(obj: T): string[]; export declare const getCapitalizeFields: (fields: Deps<unknown>) => string[]; export declare function getHandlerNames(keys: string[]): { handlerName: string; key: string[]; }[]; export declare function generateReducers<T extends Record<string, unknown>>(initialState: T): ManagerReducers<T, import("@reduxjs/toolkit").SliceCaseReducers<T>>; export declare function getMetaByAction<T extends Record<string, unknown>>(action: PayloadAction): { fieldName: any; managerName: string; };