Coding task · JavaScript and TypeScript course · Module 9: Design Patterns and Architecture
Exercise: Event Bus
Implement an Event Bus for communication between park modules.
Task
The index.js file has the EventBus class from the SOLID lesson. Fill in the blanks: ___BLANK1___ is the array method that adds the callback at the end of the event list, ___BLANK2___ is the array method that returns a new array without the removed callback, and ___BLANK3___ is the call of the callback cb with the event data. publish should pass the data to every subscriber of the event, and after unsubscribe the removed callback must not receive anything.