Ember model reloading in interval

前端 未结 3 1451
无人共我
无人共我 2021-02-13 07:28

I have a User model, which has latitude and longitude properties, which are used to show current user location on map.

App.User = DS.Model.extend({
    firstName         


        
3条回答
  •  隐瞒了意图╮
    2021-02-13 07:54

    For those who are coming across this question now -- don't use setInterval, it's been shown to cause serious memory leaks.

    Use Ember's own Ember.run.later instead.

    See also:

    • SetTimeout vs. Ember.run.later in an ember app?
    • http://guides.emberjs.com/v1.12.0/cookbook/working_with_objects/continuous_redrawing_of_views/
    • https://www.slideshare.net/yoranbe/presentation-31170160

    Edit: Feb 3, 2019 - Update broken links.

提交回复
热议问题