Skip to content

Instantly share code, notes, and snippets.

View appy-one's full-sized avatar

Ewout Stortenbeker appy-one

  • 8:45 Tools
  • The Netherlands
  • X @4ewout
View GitHub Profile
@appy-one
appy-one / db.js
Created December 18, 2020 16:37
Using AceBase instead of Dexie.js to store sticky notes in the browser's IndexedDB. See Andy Haskell's IndexedDB tutorial Part 4 at https://dev.to/andyhaskell/using-dexie-js-to-write-slick-indexeddb-code-304o
let { AceBase } = require('acebase');
// Database contains all IndexedDB database logic for our web app.
class Database {
// The constructor opens/creates the database titled 'my_db_(namespace)'
constructor(namespace) {
// Use AceBase.WithIndexedDB to create an AceBase instance
// that uses IndexedDB to store its data
let name = Database.dbName(namespace);