Make ActionFetchResponse a class with a constructor.
This commit is contained in:
parent
5f1cd195af
commit
8437515904
@ -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<ActionFetchResponse>;
|
||||
|
||||
/**
|
||||
* 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<ActionFetchResponse>) {
|
||||
this.actions = actions;
|
||||
this.fetchNextPage = fetchNextPage;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user