File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -6,11 +6,11 @@ export const dataSourceMarker = Symbol('Data Source Marker');
6
6
/**
7
7
* A model which can be used to retrieve data asynchronously
8
8
*/
9
- export interface DataSource < T > {
9
+ export interface DataSource < T , R = unknown > {
10
10
/**
11
11
* Retrieves data of type T in the form of an observable
12
12
*/
13
- getData ( ) : Observable < T > ;
13
+ getData ( request ?: R ) : Observable < T > ;
14
14
15
15
/**
16
16
* A marker property used to determine if the implementing class is
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ export class DefaultModelApi implements ModelApi {
69
69
/**
70
70
* @inheritdoc
71
71
*/
72
- public getData < T > ( ) : Observable < T > {
72
+ public getData < T , R > ( request ?: R ) : Observable < T > {
73
73
const dataSource = this . dataSourceManager . getClosest < T > ( this . model ) ;
74
74
75
75
if ( ! dataSource ) {
@@ -78,7 +78,7 @@ export class DefaultModelApi implements ModelApi {
78
78
return EMPTY ;
79
79
}
80
80
81
- return dataSource . getData ( ) ;
81
+ return dataSource . getData ( request ) ;
82
82
}
83
83
84
84
/**
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ export interface ModelApi {
32
32
* attached to)
33
33
* - Else, recurse upwards to parent
34
34
*/
35
- getData < T > ( ) : Observable < T > ;
35
+ getData < T , R = unknown > ( request ?: R ) : Observable < T > ;
36
36
37
37
/**
38
38
* Retrieves the merged theme specified for this model
You can’t perform that action at this time.
0 commit comments