From 833c61a3032163bc747fab448b7ee10841ba1788 Mon Sep 17 00:00:00 2001 From: Markus Grigull Date: Fri, 2 Oct 2015 02:08:35 +0200 Subject: [PATCH] Add polling data every second --- app/models/entity.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/models/entity.js b/app/models/entity.js index 1b6bebe..e6af0b6 100644 --- a/app/models/entity.js +++ b/app/models/entity.js @@ -6,12 +6,12 @@ export default DS.Model.extend({ properties: DS.attr(), poll: function() { - Ember.debug("Poll"); + var _this = this; + Ember.run.later( function() { + Ember.debug("reload"); - var _this = this; - Ember.run.later(function() { - _this.reload(); - _this.poll(); - }, 500); - }.observes('didLoad') + _this.reload(); + _this.poll(); + }, 1000); + }.on('didLoad') });