Skip to content

Instantly share code, notes, and snippets.

@shiawuen
Created March 17, 2011 03:56
Show Gist options
  • Save shiawuen/873813 to your computer and use it in GitHub Desktop.
Save shiawuen/873813 to your computer and use it in GitHub Desktop.
Problem with using Depot.add, callback never get trigger and the line after the add never get executed. Failed silently…
var db = new Mojo.Depot(
{ name: 'my_wordpress_db', version: 1, estimatedSize: 25000, replace: false },
function() { Mojo.Log.info('Success'); },
function(error) { Mojo.Log.warn('Unable to open database (#' +error+ ')' ); }
);
// NOT WORKING
db.add(
'address', 'address',
function(){ Mojo.Log.info('Address Added'); },
function(error) { Mojo.Log.warn('Unable to saved. %j', error) }
);
// NOT WORKING
db.add(
'address', {value: 'address'},
function(){ Mojo.Log.info('Address Added'); },
function(error) { Mojo.Log.warn('Unable to saved. %j', error) }
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment