O'Reilly logo

Backbone.js Cookbook by Vadim Mirgorod

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the polling technique to fetch data

In the previous recipes, we were fetching data into a collection each time the router processed a URL change. We may wonder what happens if someone else updates data in the same storage? Can we see the updates immediately?

You might have seen how Facebook or Twitter updates a news feed in real time, and you may want to implement a similar behavior in your application. Typically, it can be done using the polling technique, which we are going to learn in this recipe.

We are going to create a web application that will update the collection view dynamically with the help of a polling technique.

Getting ready...

Override Backbone.Model and Backbone.Collection to support the MongoDB Extended JSON format, which is ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required