Skip to content

Commit c28c84e

Browse files
committed
Revert "fix: Remove unused var"
This reverts commit d059dff.
1 parent abcc686 commit c28c84e

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

packages/hub/src/scope.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ import { Session } from './session';
2525
* called by the client before an event will be sent.
2626
*/
2727
export class Scope implements ScopeInterface {
28+
/** Flag if notifiying is happening. */
29+
protected _notifyingListeners: boolean = false;
30+
2831
/** Callback for client to receive scope changes. */
2932
protected _scopeListeners: Array<(scope: Scope) => void> = [];
3033

@@ -435,9 +438,13 @@ export class Scope implements ScopeInterface {
435438
* This will be called on every set call.
436439
*/
437440
protected _notifyScopeListeners(): void {
438-
this._scopeListeners.forEach(callback => {
439-
callback(this);
440-
});
441+
if (!this._notifyingListeners) {
442+
this._notifyingListeners = true;
443+
this._scopeListeners.forEach(callback => {
444+
callback(this);
445+
});
446+
this._notifyingListeners = false;
447+
}
441448
}
442449

443450
/**

0 commit comments

Comments
 (0)