Function
Static Public Summary | ||
public |
async getFileStorage(param: Object): IDBFileStorage Retrieve an IDBFileStorage instance by name (and it creates the indexedDB if it doesn't exist yet). |
|
public |
waitForDOMRequest(req: IDBRequest | DOMRequest, onsuccess: function): Promise Wraps a DOMRequest into a promise, optionally transforming the result using the onsuccess callback. |
Static Public
public async getFileStorage(param: Object): IDBFileStorage source
import {getFileStorage} from 'idb-file-storage/src/idb-file-storage.js'
Retrieve an IDBFileStorage instance by name (and it creates the indexedDB if it doesn't exist yet).
public waitForDOMRequest(req: IDBRequest | DOMRequest, onsuccess: function): Promise source
import {waitForDOMRequest} from 'idb-file-storage/src/idb-file-storage.js'
Wraps a DOMRequest into a promise, optionally transforming the result using the onsuccess callback.
Params:
Name | Type | Attribute | Description |
req | IDBRequest | DOMRequest | The DOMRequest instance to wrap in a Promise. |
|
onsuccess | function |
|
An optional onsuccess callback which can transform the result before resolving it. |
Return:
Promise | The promise which wraps the request result, rejected if the request.onerror has been called. |