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
Parameter |
Type |
Description |
---|---|---|
f |
(api: NotificationsApi) => Promise<T> | |
deps |
any[] |
(Optional) |
{ 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; }