-
Notifications
You must be signed in to change notification settings - Fork 8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(sidebar): toggle performance issues (#5658)
* refactor: improve observable layout change sharing * feat: add safe delayed event of layout change * fix: replace change layout with safe change * fix: limit front card width to prevent map overflow before repaint
- Loading branch information
Showing
13 changed files
with
35 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,26 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { Observable, Subject } from 'rxjs'; | ||
import { delay, share } from 'rxjs/operators'; | ||
import { delay, shareReplay, debounceTime } from 'rxjs/operators'; | ||
|
||
@Injectable() | ||
export class LayoutService { | ||
|
||
protected layoutSize$ = new Subject(); | ||
protected layoutSizeChange$ = this.layoutSize$.pipe( | ||
shareReplay({ refCount: true }), | ||
); | ||
|
||
changeLayoutSize() { | ||
this.layoutSize$.next(); | ||
} | ||
|
||
onChangeLayoutSize(): Observable<any> { | ||
return this.layoutSize$.pipe( | ||
share(), | ||
delay(1), | ||
return this.layoutSizeChange$.pipe(delay(1)); | ||
} | ||
|
||
onSafeChangeLayoutSize(): Observable<any> { | ||
return this.layoutSizeChange$.pipe( | ||
debounceTime(350), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters