-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Closed
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: cdk/tablefeatureThis issue represents a new feature or feature request rather than a bug or bug fixThis issue represents a new feature or feature request rather than a bug or bug fix
Description
Feature Description
Problem
Currently the CdkTableDataSourceInput<T>
is not an exported type in cdk/table/table.ts
. Therefore consumers of the cdk table might have to duplicate the type definition in their code base when building their components based on cdk table.
Proposed Solution
export
the type so that consumer of the cdk table could make use of this type when basing/wrapping their components based on cdk table. #
components/src/cdk/table/table.ts
Line 108 in 73008a4
type CdkTableDataSourceInput<T> = readonly T[] | DataSource<T> | Observable<readonly T[]>; |
This behavior is similar to that of TrackByFunction<T>
Example Wrapper
// Unnecessary code duplication
type CdkTableDataSourceInput<T> =
| readonly T[]
| DataSource<T>
| Observable<readonly T[]>;
@Component({
selector: 'wrapper-table',
...
})
export class WrapperTableComponent<T> {
@Input()
dataSource: CdkTableDataSourceInput<T>;
@Input()
trackBy: TrackByFunction<T>;
...
Use Case
No response
Metadata
Metadata
Assignees
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: cdk/tablefeatureThis issue represents a new feature or feature request rather than a bug or bug fixThis issue represents a new feature or feature request rather than a bug or bug fix