Skip to content

Commit fd0f947

Browse files
committed
address some comments
1 parent 7a02fd4 commit fd0f947

File tree

9 files changed

+157
-93
lines changed

9 files changed

+157
-93
lines changed

src/cdk/collections/data-source.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*/
88

99
import {Observable} from 'rxjs/Observable';
10-
import {of} from 'rxjs/observable/of';
1110
import {CollectionViewer} from './collection-viewer';
1211

1312

@@ -31,15 +30,3 @@ export abstract class DataSource<T> {
3130
*/
3231
abstract disconnect(collectionViewer: CollectionViewer): void;
3332
}
34-
35-
36-
/** DataSource wrapper for a native array. */
37-
export class ArrayDataSource<T> implements DataSource<T> {
38-
constructor(private _data: T[]) {}
39-
40-
connect(): Observable<T[]> {
41-
return of(this._data);
42-
}
43-
44-
disconnect() {}
45-
}

src/cdk/collections/public-api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
export * from './collection-viewer';
1010
export * from './data-source';
1111
export * from './selection';
12+
export * from './static-array-data-source';
1213
export {
1314
UniqueSelectionDispatcher,
1415
UniqueSelectionDispatcherListener,
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
import {Observable} from 'rxjs/Observable';
10+
import {of as observableOf} from 'rxjs/observable/of';
11+
import {DataSource} from './data-source';
12+
13+
14+
/** DataSource wrapper for a native array. */
15+
export class StaticArrayDataSource<T> implements DataSource<T> {
16+
constructor(private _data: T[]) {}
17+
18+
connect(): Observable<T[]> {
19+
return observableOf(this._data);
20+
}
21+
22+
disconnect() {}
23+
}

src/cdk/scrolling/public-api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
export * from './for-of';
9+
export * from './virtual-for-of';
1010
export * from './scroll-dispatcher';
1111
export * from './scrollable';
1212
export * from './scrolling-module';

src/cdk/scrolling/scrolling-module.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import {PlatformModule} from '@angular/cdk/platform';
1010
import {NgModule} from '@angular/core';
11-
import {CdkForOf} from './for-of';
11+
import {CdkVirtualForOf} from './virtual-for-of';
1212
import {SCROLL_DISPATCHER_PROVIDER} from './scroll-dispatcher';
1313
import {CdkScrollable} from './scrollable';
1414
import {CdkVirtualScrollFixedSize} from './virtual-scroll-fixed-size';
@@ -17,13 +17,13 @@ import {CdkVirtualScrollViewport} from './virtual-scroll-viewport';
1717
@NgModule({
1818
imports: [PlatformModule],
1919
exports: [
20-
CdkForOf,
20+
CdkVirtualForOf,
2121
CdkScrollable,
2222
CdkVirtualScrollFixedSize,
2323
CdkVirtualScrollViewport,
2424
],
2525
declarations: [
26-
CdkForOf,
26+
CdkVirtualForOf,
2727
CdkScrollable,
2828
CdkVirtualScrollFixedSize,
2929
CdkVirtualScrollViewport,

0 commit comments

Comments
 (0)