A case for evented models


I’ve read the discussion in:

And I understand the ration beneath such decision. However I have this scenario that I don’t see how to properly implement without event handlers:

Suppose some external event (e.g. a websocket message) informs me (a service) that a model has been destroyed server-side. I would like to see if the current route is using such model and transition away.

An evented approach would be to listen to model’s destroy event and act within the route itself, however this is deprecated. How should this should be addressed otherwise?


The concept of event handling itself is not deprecated, just the in-Ember implementation. In your case, the service would receive the notification of the destruction and that would be the place to fire an event. Your route could listen for it and then transition if affected.