Skip to content

Commit 8a724b9

Browse files
committed
fix observable type
1 parent e8e92d8 commit 8a724b9

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/lib/core/data-table/data-table.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export class CdkTable<T> implements CollectionViewer {
7676
new BehaviorSubject<{start: number, end: number}>({start: 0, end: Number.MAX_VALUE});
7777

7878
/** Stream that emits when a row def has a change to its array of columns to render. */
79-
columnsChange = new Observable<void[]>();
79+
_columnsChange = new Observable<void>();
8080

8181
/**
8282
* Map of all the user's defined columns identified by name.
@@ -131,23 +131,24 @@ export class CdkTable<T> implements CollectionViewer {
131131

132132
// Get and merge the streams for column changes made to the row defs
133133
const rowDefs = [...this._rowDefinitions.toArray(), this._headerDefinition];
134-
const columnChangeStreams = rowDefs.map((rowDef: BaseRowDef) => rowDef.columnsChange);
135-
this.columnsChange = Observable.combineLatest(columnChangeStreams);
134+
const columnChangeStreams =
135+
rowDefs.map((rowDef: BaseRowDef) => rowDef.columnsChange);
136+
this._columnsChange = Observable.merge(...columnChangeStreams);
136137
}
137138

138139
ngAfterViewInit() {
139140
this.renderHeaderRow();
140141

141142
// Re-render the header row if the columns changed.
142-
this.columnsChange.subscribe(() => {
143+
this._columnsChange.subscribe(() => {
143144
this._headerRowPlaceholder.viewContainer.clear();
144145
this.renderHeaderRow();
145146
});
146147

147148
// TODO(andrewseguin): If the data source is not
148149
// present after view init, connect it when it is defined.
149150
// TODO(andrewseguin): Unsubscribe from this on destroy.
150-
const streams = [this.dataSource.connect(this), this.columnsChange];
151+
const streams = [this.dataSource.connect(this), this._columnsChange];
151152
Observable.combineLatest(streams).subscribe(([rowsData]) => {
152153
this.renderRowChanges(rowsData);
153154
});

0 commit comments

Comments
 (0)