Has anyone had any luck using `Object.create` for reconstituting class instances from the plain data objects that IndexDB gives back to you?

Like, from the docs it feels like I should be able to call `Object.create(MyCoolClass, dataFromIDB)`, but that gives an odd error, complaining about one of the root props in the data object.

The bottom line in this MDN example is basically exactly what I am trying to do, so I assume it might work?

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create#using_propertiesobject_argument_with_object.create

#JavaScript #IndexDB #WebDev

Object.create() - JavaScript | MDN

The Object.create() static method creates a new object, using an existing object as the prototype of the newly created object.

MDN Web Docs
Strange thread re., #DBMS connectivity for #Javascript: http://bit.ly/r87a5F . #WebDB #ODBC #LinkedData #IndexDB

Playing a bit with PouchDB currently.
It abstracts IndexDB for offline db usage directly in the browser and has the ability to sync it optionally with an online couchdb instance!

It is quiet nice, you should give it a try:

https://pouchdb.com/

#database #javascript #indexdb #offline #sync #pouchdb #couchdb

PouchDB, the JavaScript Database that Syncs!