diff --git a/src/util/emitter.ts b/src/util/emitter.ts index 0fe74d4e..cb008f62 100644 --- a/src/util/emitter.ts +++ b/src/util/emitter.ts @@ -9,7 +9,7 @@ export class Emitter { // callback will run at a time, assuming the event is // sent with "await send(...)" and not just "send(...)". _callbacks : Callback[] = []; - changeKey : number = 0; // this becomes a new random value with every update + changeKey : string = 'init'; // this becomes a new random value with every update constructor() { } subscribe(cb : Callback) : Thunk { @@ -20,7 +20,7 @@ export class Emitter { }; } async send(t : T) : Promise { - this.changeKey = Math.random(); + this.changeKey = '' + Math.random(); for (let cb of this._callbacks) { let result = cb(t); if (result instanceof Promise) {