Skip to content

Instantly share code, notes, and snippets.

View simonberger's full-sized avatar

Simon Berger simonberger

  • Hamburg, Germany
View GitHub Profile
@simonberger
simonberger / EventSystem.js
Last active March 11, 2021 13:00 — forked from minwe/EventSystem.js
Global event system for React.js
class EventSystem {
constructor() {
this.queue = {};
}
publish(event, data) {
let queue = this.queue[event];
if (typeof queue === 'undefined') {
return false;