react-native-use-persist-storage
Version:
Persist and rehydrate a context store by React Hooks
15 lines (14 loc) • 550 B
TypeScript
import { PersistStorageValue } from "./usePersistStorage";
export declare type TMigrations = {
[version: number]: (state: any) => any;
};
export declare type TMigrationFuncParams = {
key: string;
state: PersistStorageValue<any>;
version: number;
};
export declare type TCreateMigrateConfig = {
debug?: boolean;
};
declare const createMigrate: <AfterValue>(migrations: TMigrations, configs?: TCreateMigrateConfig) => ({ key, state, version }: TMigrationFuncParams) => PersistStorageValue<AfterValue>;
export default createMigrate;