O'Reilly logo

JavaScript at Scale by Adam Boduch

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

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 ...

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