From f5e5091b102e78e8bc3b32353b995a2de50ca7a1 Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Thu, 19 Aug 2021 23:14:26 +0200 Subject: [PATCH] perf: debounce activity updates --- tabby-core/src/components/baseTab.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tabby-core/src/components/baseTab.component.ts b/tabby-core/src/components/baseTab.component.ts index ddae7fbd..d97056f4 100644 --- a/tabby-core/src/components/baseTab.component.ts +++ b/tabby-core/src/components/baseTab.component.ts @@ -1,4 +1,4 @@ -import { Observable, Subject, distinctUntilChanged } from 'rxjs' +import { Observable, Subject, distinctUntilChanged, debounceTime } from 'rxjs' import { EmbeddedViewRef, ViewContainerRef, ViewRef } from '@angular/core' import { RecoveryToken } from '../api/tabRecovery' import { BaseComponent } from './base.component' @@ -71,7 +71,7 @@ export abstract class BaseTabComponent extends BaseComponent { get blurred$ (): Observable { return this.blurred } get titleChange$ (): Observable { return this.titleChange.pipe(distinctUntilChanged()) } get progress$ (): Observable { return this.progress.pipe(distinctUntilChanged()) } - get activity$ (): Observable { return this.activity } + get activity$ (): Observable { return this.activity.pipe(debounceTime(500)) } get destroyed$ (): Observable { return this.destroyed } get recoveryStateChangedHint$ (): Observable { return this.recoveryStateChangedHint }