You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Being able to specify database name to use in the library #8
Currently the library works with a hardcoded database name. We need to refactor the code to pass the name into the library so multiple databases can be used with it.
Activity
Jatkingmodern commentedon Sep 14, 2025
// before
const DB_NAME = "app_db";
export function openDB() { return open(DB_NAME); }
// after
export function openDB(dbName = "app_db") { return open(dbName); }
// or for OO API:
class Lib {
constructor({ dbName = "app_db" } = {}) { this.dbName = dbName; }
open() { return open(this.dbName); }
}
Contributing above template to refactor code so as to maintain multiple database connectivity