aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/dispatcher.js
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/dispatcher.js')
-rw-r--r--frontend/src/dispatcher.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/frontend/src/dispatcher.js b/frontend/src/dispatcher.js
index ef5dbde..32f3f33 100644
--- a/frontend/src/dispatcher.js
+++ b/frontend/src/dispatcher.js
@@ -24,7 +24,7 @@ class Dispatcher {
}
dispatch = (topic, payload) => {
- this.listeners.filter(l => l.topic === topic).forEach(l => l.callback(payload));
+ this.listeners.filter((l) => l.topic === topic).forEach((l) => l.callback(payload));
};
register = (topic, callback) => {
@@ -34,20 +34,20 @@ class Dispatcher {
if (typeof topic === "string") {
this.listeners.push({topic, callback});
} else if (typeof topic === "object" && Array.isArray(topic)) {
- topic.forEach(e => {
+ topic.forEach((e) => {
if (typeof e !== "string") {
throw new Error("all topics must be strings");
}
});
- topic.forEach(e => this.listeners.push({e, callback}));
+ topic.forEach((e) => this.listeners.push({e, callback}));
} else {
throw new Error("topic must be a string or an array of strings");
}
};
unregister = (callback) => {
- _.remove(this.listeners, l => l.callback === callback);
+ _.remove(this.listeners, (l) => l.callback === callback);
};
}