wochenbericht-manager/src/jsx/static/notify.jsx

19 lines
436 B
JavaScript

import { Log } from "./debug";
export class Notify{
static onEventsArray = [];
static on(func){
Notify.onEventsArray.push(func);
}
/**
*
* @param {*} data {title:"",body:"",type:""}
*/
static emit(data){
Log.debug('Notify emit');
for(var f in Notify.onEventsArray){
Log.debug(Notify.onEventsArray[f]);
Notify.onEventsArray[f](data);
}
}
}