Web Dev Solutions

Catalin Mititiuc

From 23188152c91a8e638ab832fa1fa122d59d1fc391 Mon Sep 17 00:00:00 2001 From: Catalin Mititiuc Date: Thu, 8 Aug 2024 15:27:12 -0700 Subject: Add additional params to observable calls; reveal counter and record logic on selections --- src/modules/observable.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/modules/observable.js') 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) => { -- cgit v1.2.3