index : btroops | |
Virtual board game-aid for BattleTroops, an infantry combat simulator wargame published by FASA in 1989. |
aboutsummaryrefslogtreecommitdiff |
diff options
Diffstat (limited to 'src/modules/observable.js')
-rw-r--r-- | src/modules/observable.js | 2 |
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) => { |