Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Mititiuc <webdevcat@proton.me>2024-05-22 09:12:47 -0700
committerCatalin Mititiuc <webdevcat@proton.me>2024-05-22 09:12:47 -0700
commit98e4fd58d8c222652f3a5bd1d8a76f7618824e17 (patch)
tree12f1486c73f39fa5190dd938f99efb0257094761 /src/modules/observable.js
parent7395df376deac945fa8f10cbc05c318b1d8dc931 (diff)
Use observable for end move and prone flag
Diffstat (limited to 'src/modules/observable.js')
-rw-r--r--src/modules/observable.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/modules/observable.js b/src/modules/observable.js
index e4f6797..c9bea9b 100644
--- a/src/modules/observable.js
+++ b/src/modules/observable.js
@@ -2,7 +2,7 @@ const observers = {};
export const Observable = Object.freeze({
notify: (event, data) => {
- observers[event].forEach((observer) => observer(data))
+ (observers[event] || []).forEach((observer) => observer(data))
},
subscribe: (event, func) => {