Skip to content

@ryanuo/utils / browser / SafeStorage

Interface: SafeStorage ​

Properties ​

clear ​

ts
clear: () => void & (options) => void;

Clear all items from storage


get ​

ts
get: <T>(key) => T | null & <T>(key, options) => T | null;

Get stored value by key

Param ​

key

Storage key

Returns ​

Stored value or null if not found/expired


remove ​

ts
remove: (key) => void & (key, options) => void;

Remove item from storage

Param ​

key

Storage key


set ​

ts
set: (key, value) => boolean & (key, value, options) => boolean;

Set value in storage

Param ​

key

Storage key

Param ​

value

Value to store

Returns ​

true if successful, false otherwise