ForbesLindesay/atdatabases

Using @databases/expo without a connection responsed on web.

Opened this issue · 0 comments

semdy commented

use following code for more compatible

export default function connect(name: string) {
  return new Database(
    new Promise((resolve) => {
      const db = openDatabase(
        name,
        undefined as any,
        undefined as any,
        undefined as any,
        (database) => {
          resolve(database);
        },
      );
      resolve(db);
    }),
  );
}

Test on Chrome version 98.0.4758.102
Windows: 11

https://github.com/ForbesLindesay/atdatabases/blob/master/packages/expo/src/index.ts#L14