Search.../

local

Used for local storage of data.

Description

Use the methods in Storage to manage local data.

Type:

StorageRead Only

Was this helpful?

Store an item in local storage

Code Example

Copy Code
1import {local} from 'wix-storage';
2
3// ...
4
5local.setItem("key", "value");
Retrieve an item from local storage

Code Example

Copy Code
1import {local} from 'wix-storage';
2
3// ...
4
5let value = local.getItem("key"); // "value"
Remove an item from local storage

Code Example

Copy Code
1import {local} from 'wix-storage';
2
3// ...
4
5local.removeItem("key");
Remove all items from local storage

Code Example

Copy Code
1import {local} from 'wix-storage';
2
3// ...
4
5local.clear();