Files
Umbraco-CMS/src/Umbraco.Web.UI.Client/libs/resources/tryExecuteAndNotify.function.ts
2023-02-21 20:22:04 +01:00

13 lines
489 B
TypeScript

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