Skip to content

Instantly share code, notes, and snippets.

@svanderbleek
Created October 21, 2013 08:02
Show Gist options
  • Select an option

  • Save svanderbleek/7080196 to your computer and use it in GitHub Desktop.

Select an option

Save svanderbleek/7080196 to your computer and use it in GitHub Desktop.
Quick and not so dirty Ember Route model polling with REST store
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