Files
Umbraco-CMS/src/Umbraco.Web.UI.Client/libs/resources/tryExecuteAndNotify.function.ts

13 lines
489 B
TypeScript
Raw Normal View History

2023-01-03 14:20:50 +01:00
/* eslint-disable @typescript-eslint/no-explicit-any */
2023-01-27 10:26:20 +01:00
import { UmbResourceController } from './resource.controller';
import { UmbControllerHostInterface } from '@umbraco-cms/controller';
2023-01-23 15:12:48 +01:00
import type { UmbNotificationOptions } from '@umbraco-cms/notification';
2023-01-02 14:55:46 +01:00
export function tryExecuteAndNotify<T>(
host: UmbControllerHostInterface,
resource: Promise<T>,
options?: UmbNotificationOptions<any>
) {
return new UmbResourceController(host, resource).tryExecuteAndNotify<T>(options);
}