Book Image

JavaScript at Scale

By : Adam Boduch
Book Image

JavaScript at Scale

By: Adam Boduch

Overview of this book

Have you ever come up against an application that felt like it was built on sand? Maybe you've been tasked with creating an application that needs to last longer than a year before a complete re-write? If so, JavaScript at Scale is your missing documentation for maintaining scalable architectures. There's no prerequisite framework knowledge required for this book, however, most concepts presented throughout are adaptations of components found in frameworks such as Backbone, AngularJS, or Ember. All code examples are presented using ECMAScript 6 syntax, to make sure your applications are ready for next generation browsers.
Table of Contents (12 chapters)
11
Index

Communication data schema

Event data isn't opaque—it has meaning that our callback functions use to make decisions on how to react. Sometimes, this data is unneeded and can be safely ignored by the callback function. However, we don't want to decide, early on, that some callback added later on isn't going to need this data. And that's something that helps our communication mechanism scale—providing the right data in the right place.

Not only does the data need to be there, readily available for consumption by each callback function, but it also needs to have a predictable structure. We'll look at approaches to establish naming conventions for the event names themselves, as well as the data that's passed along to the handler functions. We can make inter-component communication a little more transparent, and thus more scalable, by making sure that the required event data is present and unlikely to be misinterpreted.

Naming conventions

Coming up with...