add action base class
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import type { UmbAction } from './action.interface.js';
|
||||
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
||||
|
||||
export abstract class UmbActionBase<ArgsType> implements UmbAction<ArgsType> {
|
||||
public args: ArgsType;
|
||||
protected _host: UmbControllerHost;
|
||||
|
||||
constructor(host: UmbControllerHost, args: ArgsType) {
|
||||
this._host = host;
|
||||
this.args = args;
|
||||
}
|
||||
|
||||
abstract execute(): Promise<void>;
|
||||
abstract destroy(): Promise<void>;
|
||||
}
|
||||
@@ -1,8 +1,6 @@
|
||||
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
||||
import type { UmbApi } from '@umbraco-cms/backoffice/extension-api';
|
||||
|
||||
export interface UmbAction<ArgsType> extends UmbApi {
|
||||
args: ArgsType;
|
||||
execute(): Promise<void>;
|
||||
_host: UmbControllerHost;
|
||||
}
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
export * from './action.interface.js';
|
||||
export * from './action-event.context.js';
|
||||
export * from './action-base.js';
|
||||
|
||||
Reference in New Issue
Block a user