From 8437515904a615cc8432b60077b08ad4baa51660 Mon Sep 17 00:00:00 2001 From: Carter Bertolini Date: Fri, 27 Oct 2023 17:31:44 -0400 Subject: [PATCH] Make ActionFetchResponse a class with a constructor. --- src/interface/actions.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/interface/actions.ts b/src/interface/actions.ts index 2fdad9c..d072fd7 100644 --- a/src/interface/actions.ts +++ b/src/interface/actions.ts @@ -99,7 +99,7 @@ export class ActionFetchOptions { /** * Represents the response of a fetch action request. */ -export interface ActionFetchResponse { +export class ActionFetchResponse { /** * An array of `Action` objects. @@ -111,6 +111,17 @@ export interface ActionFetchResponse { * Returns a promise that resolves to an `ActionFetchResponse` object. */ readonly fetchNextPage?: () => Promise; + + /** + * Creates an instance of the Actions class. + * @constructor + * @param actions The list of actions. + * @param fetchNextPage A function that fetches the next page of actions. + */ + constructor(actions: Action[], fetchNextPage?: () => Promise) { + this.actions = actions; + this.fetchNextPage = fetchNextPage; + } } /**