<T>(key: string, is_json?: boolean, parse_fn?: ((value: unknown) => T | null) | undefined): T | null Utility function to load a value from localStorage with optional parsing
key
The localStorage key
type
stringis_json
Whether to parse the value as JSON
type
boolean default
falseparse_fn?
Optional custom parsing function to transform the value
type
((value: unknown) => T | null) | undefinedoptional
returns
T | null The parsed value or null if not found or parsing fails