Static Public Summary | ||
public | asyncgetFileStorage(param:Object):IDBFileStorage Retrieve an IDBFileStorage instance by name (and it creates the indexedDB if it doesn'texist yet). | |
public | waitForDOMRequest(req:IDBRequest |DOMRequest, onsuccess:function):Promise Wraps a DOMRequest into a promise, optionally transforming the result using the onsuccesscallback. |
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'texist yet).
IDBFileStorage | The IDBFileStorage instance with the given name. |
import {waitForDOMRequest} from 'idb-file-storage/src/idb-file-storage.js'
Wraps a DOMRequest into a promise, optionally transforming the result using the onsuccesscallback.
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. |
Promise | The promise which wraps the request result, rejected if the request.onerror has been called. |