Methods
# clear() → {external:Promise}
Clears all the stored data of an extension
external:Promise
Example
extension.store.clear().then((success) => console.log(success)) // will log ‘true’ when values are cleared
# get(key) → {external:Promise}
Gets the value of key
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string
|
Key of the stored data |
external:Promise
Example
extension.store.get('key').then((value) => console.log(value)) // will log value for the given key
# getAll() → {external:Promise}
Gets an object with all the stored key-value pairs.
external:Promise
Example
extension.store.getAll().then((obj) => obj)
# remove(key) → {external:Promise}
Removes the value of a key
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string
|
Key of the data to be removed from the store |
external:Promise
Example
extension.store.remove('key').then((success) => console.log(success)) // will log ‘true’ when value is removed
# set(key, value) → {external:Promise}
Sets the value of a key
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string
|
Key of the stored data. |
value |
*
|
Data to be stored. |
external:Promise
Example
extension.store.set('key', 'value').then((success) => console.log(success)) // will log ‘true’ when value is set