MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / createStore

Function createStore

packages/browser/src/transports/offline.ts:44–50  ·  view source on GitHub ↗
(dbName: string, storeName: string)

Source from the content-addressed store, hash-verified

42
43/** Create or open an IndexedDb store */
44export function createStore(dbName: string, storeName: string): Store {
45 const request = indexedDB.open(dbName);
46 request.onupgradeneeded = () => request.result.createObjectStore(storeName);
47 const dbp = promisifyRequest(request);
48
49 return callback => dbp.then(db => callback(db.transaction(storeName, 'readwrite').objectStore(storeName)));
50}
51
52function keys(store: IDBObjectStore): Promise<number[]> {
53 return promisifyRequest(store.getAllKeys() as IDBRequest<number[]>);

Callers 2

offline.test.tsFile · 0.90
getStoreFunction · 0.85

Calls 4

promisifyRequestFunction · 0.85
openMethod · 0.80
callbackFunction · 0.50
thenMethod · 0.45

Tested by

no test coverage detected