Skip to content
This repository has been archived by the owner on Aug 25, 2018. It is now read-only.

Commit

Permalink
Add event for initial sync, closes #13
Browse files Browse the repository at this point in the history
  • Loading branch information
anantn committed Nov 22, 2013
1 parent 2bd6c03 commit 8c2b2ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions backbone-firebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@
this.firebase.on("child_changed", _.bind(this._childChanged, this));
this.firebase.on("child_removed", _.bind(this._childRemoved, this));

// Once handler to emit "sync" event.
this.firebase.once("value", _.bind(function() {
this.trigger("sync", this, null, null);
}, this));

// Handle changes in any local models.
this.listenTo(this, "change", this._updateModel, this);
// Listen for destroy event to remove models.
Expand Down
2 changes: 1 addition & 1 deletion backbone-firebase.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8c2b2ad

Please sign in to comment.