Files
Umbraco-CMS/src/Umbraco.Web.UI.Client/libs/resources/tryExecuteAndNotify.method.ts
2023-01-23 15:12:48 +01:00

13 lines
489 B
TypeScript

/* eslint-disable @typescript-eslint/no-explicit-any */
import { UmbControllerHostInterface } from '@umbraco-cms/controller';
import type { UmbNotificationOptions } from '@umbraco-cms/notification';
import { UmbResourceController } from './resource.controller';
export function tryExecuteAndNotify<T>(
host: UmbControllerHostInterface,
resource: Promise<T>,
options?: UmbNotificationOptions<any>
) {
return new UmbResourceController(host, resource).tryExecuteAndNotify<T>(options);
}