Type Alias GetItem<T>

GetItem<T>: ((key: string) => Promise<T | null>) | ((key: string) => T | null)

Handles persisted state loading.

Type Parameters

  • T

String identifying persisted state (like in localStorage.getItem(key)).

T - The storage state type.

The persisted state or null if no state exists in the storage. May return a promise resolving to the forementioned value.