UNPKG

tg-use-local-storage-state

Version:
21 lines (20 loc) 793 B
declare const _default: { data: Map<string, unknown>; get<T>(key: string, defaultValue: T, options?: { isSimpleString?: boolean | undefined; } | undefined): T | undefined; set<T_1>(key: string, value: T_1, options?: { isSimpleString?: boolean | undefined; } | undefined): void; remove(key: string): void; }; /** * Abstraction for localStorage that uses an in-memory fallback when localStorage throws an error. * Reasons for throwing an error: * - maximum quota is exceeded * - under Mobile Safari (since iOS 5) when the user enters private mode `localStorage.setItem()` * will throw * - trying to access localStorage object when cookies are disabled in Safari throws * "SecurityError: The operation is insecure." */ export default _default;