react-native-use-persist-storage
Version:
Persist and rehydrate a context store by React Hooks
9 lines (8 loc) • 393 B
TypeScript
declare type TValue = string | null;
declare type TCallback = (err: any, data: TValue | any[]) => void;
declare const createAsyncStorage: () => {
getItem(key: string, callback?: TCallback): Promise<TValue>;
setItem(key: string, value: string, callback?: TCallback): Promise<void>;
removeItem(key: string, callback?: TCallback): Promise<void>;
};
export default createAsyncStorage;