File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,9 @@ import { Session } from './session';
25
25
* called by the client before an event will be sent.
26
26
*/
27
27
export class Scope implements ScopeInterface {
28
+ /** Flag if notifiying is happening. */
29
+ protected _notifyingListeners : boolean = false ;
30
+
28
31
/** Callback for client to receive scope changes. */
29
32
protected _scopeListeners : Array < ( scope : Scope ) => void > = [ ] ;
30
33
@@ -435,9 +438,13 @@ export class Scope implements ScopeInterface {
435
438
* This will be called on every set call.
436
439
*/
437
440
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
+ }
441
448
}
442
449
443
450
/**
You can’t perform that action at this time.
0 commit comments