Skip to content

Instantly share code, notes, and snippets.

@katowulf
Created January 14, 2013 17:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save katowulf/4531637 to your computer and use it in GitHub Desktop.
Save katowulf/4531637 to your computer and use it in GitHub Desktop.
function _updateModel(model, options) {
var firebase = this.firebase;
var changes = model.changedAttributes();
if( changes ) {
setTimeout(function() { // make sure change events fire before Firebase notifies on() listener
firebase.child(model.id).update(changes);
}, 0);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment