File tree Expand file tree Collapse file tree 5 files changed +11
-4
lines changed Expand file tree Collapse file tree 5 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ export class PersonDataSource extends DataSource<any> {
13
13
14
14
connect ( ) : Observable < UserData [ ] > {
15
15
const displayDataChanges = [
16
- this . _paginator . page ,
16
+ this . _paginator . page ,
17
17
this . _sort . mdSortChange ,
18
18
this . _peopleDatabase . dataChange
19
19
] ;
@@ -26,6 +26,10 @@ export class PersonDataSource extends DataSource<any> {
26
26
} ) ;
27
27
}
28
28
29
+ disconnect ( ) {
30
+ // No-op
31
+ }
32
+
29
33
/** Returns a sorted copy of the database data. */
30
34
getSortedData ( ) : UserData [ ] {
31
35
const data = this . _peopleDatabase . data . slice ( ) ;
Original file line number Diff line number Diff line change @@ -14,5 +14,5 @@ export interface CollectionViewer {
14
14
15
15
export abstract class DataSource < T > {
16
16
abstract connect ( collectionViewer : CollectionViewer ) : Observable < T [ ] > ;
17
- disconnect ( ) { }
17
+ abstract disconnect ( collectionViewer : CollectionViewer ) : void ;
18
18
}
Original file line number Diff line number Diff line change @@ -185,7 +185,7 @@ export class CdkTable<T> implements CollectionViewer {
185
185
this . _onDestroy . next ( ) ;
186
186
this . _onDestroy . complete ( ) ;
187
187
if ( this . dataSource ) {
188
- this . dataSource . disconnect ( ) ;
188
+ this . dataSource . disconnect ( this ) ;
189
189
}
190
190
}
191
191
@@ -242,7 +242,7 @@ export class CdkTable<T> implements CollectionViewer {
242
242
this . _data = [ ] ;
243
243
244
244
if ( this . _dataSource ) {
245
- this . dataSource . disconnect ( ) ;
245
+ this . dataSource . disconnect ( this ) ;
246
246
}
247
247
this . _dataSource = dataSource ;
248
248
Original file line number Diff line number Diff line change @@ -203,6 +203,7 @@ class FakeDataSource extends DataSource<any> {
203
203
connect ( collectionViewer : CollectionViewer ) : Observable < any [ ] > {
204
204
return map . call ( collectionViewer . viewChange , ( ) => [ ] ) ;
205
205
}
206
+ disconnect ( ) { }
206
207
}
207
208
208
209
@Component ( {
Original file line number Diff line number Diff line change @@ -68,6 +68,8 @@ class FakeDataSource extends DataSource<TestData> {
68
68
return this . _dataChange ;
69
69
}
70
70
71
+ disconnect ( ) { }
72
+
71
73
addData ( ) {
72
74
const nextIndex = this . data . length + 1 ;
73
75
You can’t perform that action at this time.
0 commit comments