This module provides convenient storage abstractions on top of extension local storage. These abstractions minimize code duplication and opportunities for error, and allow us to switch the underlying storage implementation in future.
Rally studies are welcome to choose any WebExtensions compatible storage option, including this module, extension local storage, IndexedDB, or an IndexedDB wrapper (e.g., Dexie.js).
- Source:
- See:
Classes
Methods
(static) createCounter(counterName) → {Promise.<Counter>}
Create a persistent counter.
Parameters:
Name | Type | Description |
---|---|---|
counterName |
string | A name that uniquely identifies the counter. |
- Source:
Returns:
A Promise that resolves to the new Counter object.
- Type
- Promise.<Counter>
(static) createKeyValueStorage(storageAreaName) → {KeyValueStorage}
Create a key-value storage area.
Parameters:
Name | Type | Description |
---|---|---|
storageAreaName |
string | A name that uniquely identifies the storage area. |
- Source:
Returns:
The new KeyValueStorage object.
- Type
- KeyValueStorage
Example
const exampleStorage = webScience.storage.createKeyValueStorage("exampleName");