Chapter 8. Listening to notifications
- Setting up event handlers on your build
- Setting up application event handlers
- Adding listeners to model updates
- Transforming any class into an event publisher
Think for a moment how your typical work day starts. You get up on time (most likely) because your alarm clock rings. You grab some warm toast for breakfast because you hear it popped from the toaster. On your way to work, you know to stop on the street because the traffic light changes to red.
What is common to all these cases is that you take action as a response to some stimulus, whether auditory (your alarm clock ringing) or visual (the traffic light). It’s as if you’re reacting to signals sent by different agents. Could ...