mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-22 14:39:34 +01:00
ev: Cannot read property 'push' of undefined
This commit is contained in:
@@ -5,7 +5,7 @@ class EventManager {
|
|||||||
|
|
||||||
subscribe(name, handler) {
|
subscribe(name, handler) {
|
||||||
if (!name || !handler) throw new Error("name and handler are required.");
|
if (!name || !handler) throw new Error("name and handler are required.");
|
||||||
if (!this._registry[name]) this._registry.name = [];
|
if (!this._registry[name]) this._registry[name] = [];
|
||||||
this._registry[name].push(handler);
|
this._registry[name].push(handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user