Events
class.Events
class should have methods 'on', 'trigger', and 'off'.My Solution
class Events {
constructor() {
// TODO
}
on(eventName, callback) {
// TODO
}
trigger(eventName) {
// TODO
}
off(eventName) {
// TODO
}
}
SG Solution
class Events {
constructor() {
// TODO
}
on(eventName, callback) {
// TODO
}
trigger(eventName) {
// TODO
}
off(eventName) {
// TODO
}
}