Function useAsyncProgress

Executes a process asynchronously with progress tracking and error handling.

  • Type Parameters

    • Data extends unknown = any

      The type of data to be processed.

    • Result = void

      The type of the process result.

    Parameters

    • process: ((item: IProcess<Data>) => Result | Promise<Result>)

      The process function to be executed on each item.

    • options: IParams<Data, Result>

      Optional parameters for customizing the process behavior.

    Returns {
        errors: IError[];
        execute: ((items: IProcess<Data>[]) => void);
        label: string;
        loading: boolean;
        progress: number;
    }

    An object containing the execute function, loading state, progress, and errors.

    • Readonlyerrors: IError[]
    • Readonlyexecute: ((items: IProcess<Data>[]) => void)
        • (items): void
        • Parameters

          • items: IProcess<Data>[]

          Returns void

    • label: string
    • loading: boolean
    • Readonlyprogress: number