Skip to content

useLocalStorage ​

Category
Browser

Hook that manages local storage value

typescript
import { useLocalStorage } from '@elysiumorg/solid-use';

Usage ​

typescript
const [value, setValue, removeValue] = useLocalStorage('local-key', { initialValue: 0, });

Demo ​

Api ​

Parameters

NameTypeDefaultNote
keystring-The key of the storage
options?UseStorageOptions<Value>-The options of the storage