Skip to content

Commit

Permalink
Merge pull request balupton#2 from nolanlawson/live-updating
Browse files Browse the repository at this point in the history
fix live updating
  • Loading branch information
broerse committed Sep 14, 2014
2 parents 9c2f15f + a2fe1c0 commit a6f1f9b
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion app/routes/posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,16 @@ import Ember from "ember";
export default Ember.Route.extend({
model: function() {
return this.get('store').find('post');
}
},
afterModel: function (recordArray) {
// This tells PouchDB to listen for live changes and
// notify Ember Data when a change comes in.
new PouchDB('bloggr').changes({
since: 'now',
live: true
}).on('change', function () {
debugger;
recordArray.update();
});
}
});

0 comments on commit a6f1f9b

Please sign in to comment.