O'Reilly logo

Backbone.js Patterns and Best Practices by Swarnendu De

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

Chapter 6. Working with Events, Sync, and Storage

In the previous chapters, we discussed each Backbone component (view, model, collection, and router) separately and in detail. In this chapter, we are going to talk about the custom events, Backbone.sync() method and Backbone.LocalStorage. Though these topics are not exactly related to each other, we placed them in a single chapter as we need to cover each one of them before we move on to application architecture and patterns in the next chapter.

Events are always considered as one of the most powerful concepts in JavaScript. They are a representation of the observer pattern (a well-known design pattern for loose coupling) and are used by most JavaScript libraries. In Backbone, Backbone.Events

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