Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//this is using promises.
dm.stores.demo.open().then( function( value ) {
var data = [
{
"id": 1,
"name": "Lea",
"type": "Skywalker"
}
];
dm.stores.demo.save( data );
start(); //this tells the test to keep going since it async
});
//The same thing using callbacks
dm.stores.demo.open({
success: function() {
var data = [
{
"id": 1,
"name": "Lea",
"type": "Skywalker"
}
];
dm.stores.demo.save( data );
start();
},
error: function() {
//error stuff
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment