Skip to content

Commit

Permalink
Changed IndexedDB to use Async
Browse files Browse the repository at this point in the history
  • Loading branch information
james-pre committed May 29, 2024
1 parent 13e6a22 commit bd38df4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/IndexedDB.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Store } from '@zenfs/core/backends/store/store.js';
import { AsyncTransaction } from '@zenfs/core/backends/store/store.js';
import type { Backend, Ino } from '@zenfs/core';
import { ErrnoError, StoreFS } from '@zenfs/core';
import { Async, ErrnoError, StoreFS } from '@zenfs/core';
import { convertException, type ConvertException } from './utils.js';

function wrap<T>(request: IDBRequest<T>): Promise<T> {
Expand Down Expand Up @@ -144,7 +144,7 @@ export const IndexedDB = {
async create(options: IndexedDBOptions) {
const db = await createDB(options.storeName || 'zenfs', options.idbFactory);
const store = new IndexedDBStore(db);
const fs = new StoreFS(store);
const fs = new (Async(StoreFS) as typeof StoreFS)(store);
return fs;
},
} as const satisfies Backend<StoreFS, IndexedDBOptions>;

0 comments on commit bd38df4

Please sign in to comment.