Skip to content

Commit

Permalink
fix live updating
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanlawson committed Sep 14, 2014
1 parent 9c2f15f commit a2fe1c0
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 a2fe1c0

Please sign in to comment.