Methods
(async) deleteItem() → {Promise}
Delete an item from storage
Example
import Agent from '@meldcx/agent';
const agent = new Agent();
const init = async() => {
await agent.onReadyAsync();
await agent.storage.deleteItem('myImportantKey');
console.log('The item myImportantKey is deleted');
};
init();
(async) getItem() → {Object|Primative}
Get the value of a key
Example
import Agent from '@meldcx/agent';
const agent = new Agent();
const init = async() => {
await agent.onReadyAsync();
const value = await agent.storage.getItem('myImportantKey');
console.log('The value of myImportantKey is:');
console.log(value); // will print "myImportantValue"
};
init();
(async) setItem() → {Promise}
Store a key/value pair item into storage.