resolveUseCancelablePromisesError()
Home > @gooddata/sdk-ui > resolveUseCancelablePromisesError
resolveUseCancelablePromisesError() function
Resolve error of multiple useCancelablePromise() hooks - gets first error in the sequence of cancelable promise states.
Signature:
export declare function resolveUseCancelablePromisesError<TError>(states: UseCancelablePromiseState<unknown, TError>[]): TError | undefined;
Parameters
Parameter |
Type |
Description |
---|---|---|
states |
UseCancelablePromiseState<unknown, TError>[] |
cancelable promise states (useCancelablePromise return values) |
Returns:
TError | undefined
first error
Remarks
This is useful for useCancelablePromise composition - when you want to wrap multiple useCancelablePromise hooks in another hook, and keep the return value shape of the hook same as for useCancelablePromise.