mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-19 20:16:04 +08:00
added try catch to dispatch event
This commit is contained in:
parent
2ae7957e37
commit
beac92f399
1 changed files with 8 additions and 1 deletions
|
@ -14,7 +14,14 @@ export function subscribeToEvent(fn) {
|
|||
}
|
||||
|
||||
function dispatchEvent(key, value, value2) {
|
||||
eventSubscribers.forEach((fn) => fn(key, value, value2));
|
||||
eventSubscribers.forEach((fn) => {
|
||||
try {
|
||||
fn(key, value, value2);
|
||||
} catch (e) {
|
||||
console.error("Config event subscriber threw an error");
|
||||
console.error(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function setLocalStorageConfig(val) {
|
||||
|
|
Loading…
Add table
Reference in a new issue