Created
October 16, 2019 18:16
-
-
Save benjamincharity/af0ccdc2bc265a030ee5678f0dc65582 to your computer and use it in GitHub Desktop.
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
public readonly headerCellResizes: Observable<TsHeaderCellResizeEvent> | Observable<{}> = defer(() => { | |
if (this.headerCells && this.headerCells.length) { | |
return merge(...this.headerCells.map(cell => cell.resized)); | |
} | |
// If there are any subscribers before `ngAfterViewInit`, `headerCells` may be undefined. | |
// In that case, return a stream that we'll replace with the real one once everything is in place. | |
return this.ngZone.onStable | |
.asObservable() | |
.pipe(take(1), switchMap(() => this.headerCellResizes)); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment