15 lines
357 B
JavaScript
15 lines
357 B
JavaScript
const MszSeasonalEvents = function() {
|
|
const events = [];
|
|
|
|
return {
|
|
add: eventInfo => {
|
|
if(!events.includes(eventInfo))
|
|
events.push(eventInfo);
|
|
},
|
|
dispatch: () => {
|
|
for(const info of events)
|
|
if(info.isActive())
|
|
info.dispatch();
|
|
},
|
|
};
|
|
};
|