Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/data/data-source/data-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ export const dataSourceMarker = Symbol('Data Source Marker');
/**
* A model which can be used to retrieve data asynchronously
*/
export interface DataSource<T> {
export interface DataSource<T, R = unknown> {
/**
* Retrieves data of type T in the form of an observable
*/
getData(): Observable<T>;
getData(request?: R): Observable<T>;

/**
* A marker property used to determine if the implementing class is
Expand Down
4 changes: 2 additions & 2 deletions src/model/api/default-model-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class DefaultModelApi implements ModelApi {
/**
* @inheritdoc
*/
public getData<T>(): Observable<T> {
public getData<T, R>(request?: R): Observable<T> {
const dataSource = this.dataSourceManager.getClosest<T>(this.model);

if (!dataSource) {
Expand All @@ -78,7 +78,7 @@ export class DefaultModelApi implements ModelApi {
return EMPTY;
}

return dataSource.getData();
return dataSource.getData(request);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/model/api/model-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export interface ModelApi {
* attached to)
* - Else, recurse upwards to parent
*/
getData<T>(): Observable<T>;
getData<T, R = unknown>(request?: R): Observable<T>;

/**
* Retrieves the merged theme specified for this model
Expand Down