Socket
Book a DemoInstallSign in
Socket

@zestic/app-storage

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zestic/app-storage

Cross platform storage

latest
Source
npmnpm
Version
0.9.17
Version published
Maintainers
1
Created
Source

AppStorage

Initialize

Add the createStore() method to the top of index.tsx after the imports. If you want to make sure the name of the storage is unique, pass that name as a parameter createStore('_zestic');

Useage

To store a value call the storeValue() function, passing in the name of the value and the value

await storeValue('hello', 'world');

To retrieve the value from the storage call

const value = await getValue('hello');

// value = 'world'

If a value has not been set, by default, a null value is returned.

If you want to set the default value, just pass it in as a second parameter.

const value = await getValue('doesNotExist', 'vanished');

// value = 'vanished'

To clear the set value, call await clearValue('hello');

FAQs

Package last updated on 30 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts