I have a single page web app with multiple backbone.js views. The views must sometimes communicate with each other. Two examples:
- When there are two ways views presenting a collection in different ways simultaneously and a click on an item in one view must be relayed to the other view.
- When a user transitions to the next stage of the process and the first view passes data to the second.
To decouple the views as much as possible I currently use custom events to pass the data ($(document).trigger('customEvent', data)
). Is there a better way to do this?