MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / promisify

Function promisify

host/storage/src/main/idb.js:4–7  ·  view source on GitHub ↗
(req)

Source from the content-addressed store, hash-verified

2
3/* IDBRequest -> Promise. Native IndexedDB is callback-only; this is the standard one-liner wrapper. */
4const promisify = (req) => new Promise((resolve, reject) => {
5 req.onsuccess = () => resolve(req.result);
6 req.onerror = () => reject(req.error);
7});
8
9export default ({ dbs, allocDb, db }) => ({
10 /* `idb_open(name, version, schema_json?)`, `schema_json` accepts `{"stores": ["name1", "name2"]}`; missing stores are created on upgrade. Returns a handle. */

Callers 1

idb.jsFile · 0.85

Calls 1

resolveFunction · 0.50

Tested by

no test coverage detected