Class

useLocalStorage

useLocalStorage(key, initialValue) → {UseLocalStorageResult.<T>}

Constructor

# new useLocalStorage(key, initialValue) → {UseLocalStorageResult.<T>}

Parameters:
Name Type Description
key string

key under which hook will store the data

initialValue T

value which will be stringified and stored

See:

View Source adminjs/src/frontend/hooks/use-local-storage/use-local-storage.ts, line 17

Type Definitions

Array

# UseLocalStorageResult

Result of the useLocalStorage.

It is a tuple containing value and the setter

Properties:
Name Type Attributes Description
0 T <optional>

the value stored in the local store

1 React.Dispatch.<React.SetStateAction.<T>> <optional>

value setter compatible with react useState

View Source adminjs/src/frontend/hooks/use-local-storage/use-local-storage-result.type.ts, line 3