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';
2525 * called by the client before an event will be sent.
2626 */
2727export 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 /**
You can’t perform that action at this time.
0 commit comments