Design Patterns · Middle · Question 9 of 75
What's the risk of a global event bus as an implementation of Mediator?
- ✓Correct answer: Data flows are implicit: it's unclear who sends an event and why
- 2An event bus can't pass data along with an event
- 3A bus can't be used together with React components
Explanation
Decoupling via event names is convenient, but as the app grows, connections hide in strings, cycles appear, and "ghost" subscribers emerge. That's why React apps usually prefer explicit flows: props, Context, a store with selectors.