This is more of an architectural question with an example.
I know Ember has many ways of communication but why is global pub/sub discouraged (not implemented)? Throwing actions seems like a one-way message bus to me.
Pub sub seems like a great use case for inter-component and service-components communication.
Simple example where pub/sub would be a simple solution:
- I have a captcha service and a captcha component.
- Captcha can be displayed on any route.
- Once you land on a route, component will render, check if captcha is used and (if yes) fetch image from service and display it.
- Once you solve the captcha you’ll click a button that belongs to a controller.
- Controller verifies the captcha with service and then either destroys the component if captcha is good or captcha component should somehow re-fetch new image.
I currently don’t have a good idea how to solve this without pub sub pattern.