Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/observable.js')
-rw-r--r--src/modules/observable.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/observable.js b/src/modules/observable.js
index c9bea9b..65394f6 100644
--- a/src/modules/observable.js
+++ b/src/modules/observable.js
@@ -1,8 +1,8 @@
const observers = {};
export const Observable = Object.freeze({
- notify: (event, data) => {
- (observers[event] || []).forEach((observer) => observer(data))
+ notify: (event, ...data) => {
+ (observers[event] || []).forEach((observer) => observer(...data))
},
subscribe: (event, func) => {