import { MMKV } from 'react-native-mmkv'; export const storage = new MMKV(); export function getItem(key: string): T { const value = storage.getString(key); // @ts-ignore return value ? JSON.parse(value) || null : null; } export async function setItem(key: string, value: T) { storage.set(key, JSON.stringify(value)); } export async function removeItem(key: string) { storage.delete(key); }