Skip to main content

useNotificationsApi()

Home > @backstage/plugin-notifications > useNotificationsApi

Signature:

function useNotificationsApi<T>(f: (api: NotificationsApi) => Promise<T>, deps?: any[]): {
retry: () => void;
loading: boolean;
error?: undefined;
value?: undefined;
} | {
retry: () => void;
loading: false;
error: Error;
value?: undefined;
} | {
retry: () => void;
loading: true;
error?: Error | undefined;
value?: T | undefined;
} | {
retry: () => void;
loading: false;
error?: undefined;
value: T;
};

Parameters

ParameterTypeDescription
f(api: NotificationsApi) => Promise<T>
depsany[](Optional)

Returns:

{ retry: () => void; loading: boolean; error?: undefined; value?: undefined; } | { retry: () => void; loading: false; error: Error; value?: undefined; } | { retry: () => void; loading: true; error?: Error | undefined; value?: T | undefined; } | { retry: () => void; loading: false; error?: undefined; value: T; }