Backbone.js updating of models in a collection

后端 未结 5 1328
天涯浪人
天涯浪人 2021-01-30 11:47

Let\'s say you are building a Twitter clone with Backbone.js. You have a collection of tweets. Each tweet is obviously an instance of the Tweet model.

You create an inst

5条回答
  •  故里飘歌
    2021-01-30 12:41

    I don't think this is a backbone issue. Using Twitter's RESTful API you can use the optional since_id parameter. After each call your collection could save the id of the most recent tweet it has fetched. Use this id in your url function and you'll only receive newer tweets.

提交回复
热议问题