Created
October 21, 2013 08:02
-
-
Save svanderbleek/7080196 to your computer and use it in GitHub Desktop.
Quick and not so dirty Ember Route model polling with REST store
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| App.ImagesRoute = Ember.Route.extend | |
| model: (-> | |
| @get('store').find('image') | |
| ).observes('pollCounter') | |
| afterModel: -> | |
| @pollModel() | |
| pollModel: -> | |
| setInterval (=> | |
| oldCounter = @get('pollCounter') || 0 | |
| @set('pollCounter', oldCounter + 1) | |
| ), 1000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment