property 'put' of undefined
MaartenProvo opened this issue · 2 comments
MaartenProvo commented
Perhaps a stupid question, I get an error can not read property 'put' of undefined. But I can't find how to fix it, searched in the example files, but no clues there.
piglovesyou commented
syncedDB.open().then()
doesn't return db
. So I guess this will work.
var db = syncedDB.open({
name: 'Ambu-DB',
// ...
});
db.then(function() {
addPatients();
}).catch(function(err) {
// ...
});
Or, because the argument of a function passed to SDBDatabase#then()
is {db: db, e: e}
, I think you can use that too.
piglovesyou commented
@MaartenProvo Tell me if you still have the problem even after the above answer.