From 6e5f24983fcb20ba9a863b1818758a7e78b70fb6 Mon Sep 17 00:00:00 2001 From: Jake <45181984+jake-bassett@users.noreply.github.com> Date: Tue, 12 Dec 2023 13:55:52 -0800 Subject: [PATCH] feat: add request argument to model-api getData method (#766) --- src/data/data-source/data-source.ts | 4 ++-- src/model/api/default-model-api.ts | 4 ++-- src/model/api/model-api.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/data/data-source/data-source.ts b/src/data/data-source/data-source.ts index 6f518967..c1dc2d50 100644 --- a/src/data/data-source/data-source.ts +++ b/src/data/data-source/data-source.ts @@ -6,11 +6,11 @@ export const dataSourceMarker = Symbol('Data Source Marker'); /** * A model which can be used to retrieve data asynchronously */ -export interface DataSource { +export interface DataSource { /** * Retrieves data of type T in the form of an observable */ - getData(): Observable; + getData(request?: R): Observable; /** * A marker property used to determine if the implementing class is diff --git a/src/model/api/default-model-api.ts b/src/model/api/default-model-api.ts index de943b0a..e7192ba2 100644 --- a/src/model/api/default-model-api.ts +++ b/src/model/api/default-model-api.ts @@ -69,7 +69,7 @@ export class DefaultModelApi implements ModelApi { /** * @inheritdoc */ - public getData(): Observable { + public getData(request?: R): Observable { const dataSource = this.dataSourceManager.getClosest(this.model); if (!dataSource) { @@ -78,7 +78,7 @@ export class DefaultModelApi implements ModelApi { return EMPTY; } - return dataSource.getData(); + return dataSource.getData(request); } /** diff --git a/src/model/api/model-api.ts b/src/model/api/model-api.ts index 7573463f..74ea358d 100644 --- a/src/model/api/model-api.ts +++ b/src/model/api/model-api.ts @@ -32,7 +32,7 @@ export interface ModelApi { * attached to) * - Else, recurse upwards to parent */ - getData(): Observable; + getData(request?: R): Observable; /** * Retrieves the merged theme specified for this model