Website Summary Files Commits Branches @commit @diff @stats
path: root / scripts / services / eventService.js
blob: 7a15903bfd8a84ea2e074ab182049ee93b749b3a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
var app = app || {};

class EventService {
    constructor() {
        this.events = {};
    }

    addEventHandler(event, handler) {
        this.events[event] = handler;
    }

    triggerEvent(event, args) {
        if(this.events[event]) {
            this.events[event].call(null, args);
        }
    }
}

app.eventService = new EventService();