Skip to content

Commit 36f6aff

Browse files
committed
fix connect function v2
1 parent 9b03212 commit 36f6aff

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/cdk/table/table.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,9 +426,8 @@ export class CdkTable<T> implements CollectionViewer, OnInit, AfterContentChecke
426426
// Cannot check this.dataSource['connect'] due to potential property renaming, nor can it
427427
// checked as an instanceof DataSource<T> since the table should allow for data sources
428428
// that did not explicitly extend DataSource<T>.
429-
const connectFunction = (this.dataSource as DataSource<T>).connect;
430-
if (connectFunction instanceof Function) {
431-
dataStream = connectFunction(this);
429+
if ((this.dataSource as DataSource<T>).connect instanceof Function) {
430+
dataStream = (this.dataSource as DataSource<T>).connect(this);
432431
} else if (this.dataSource instanceof Observable) {
433432
dataStream = this.dataSource;
434433
} else if (Array.isArray(this.dataSource)) {

0 commit comments

Comments
 (0)