Files
Umbraco-CMS/src/Umbraco.Web.UI.Client/libs/resources/tryExecuteAndNotify.method.ts
2023-01-20 13:19:42 +01:00

13 lines
504 B
TypeScript

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