mirror of
https://gitlab.com/bramw/baserow.git
synced 2024-11-21 23:37:55 +00:00
20 lines
258 B
JavaScript
20 lines
258 B
JavaScript
export class Observer {
|
|
constructor() {
|
|
this.clear()
|
|
}
|
|
|
|
clear() {
|
|
this.events = []
|
|
}
|
|
|
|
fire(...args) {
|
|
for (const event in this.events) {
|
|
this.events[event](...args)
|
|
}
|
|
}
|
|
|
|
register(event) {
|
|
this.events.push(event)
|
|
}
|
|
}
|