Type alias TaskAsyncFunction<Data, Response>

TaskAsyncFunction<Data, Response>: ((data?) => Promise<Response>)

Task asynchronous function that can be executed. This function must return a promise.

Type Parameters

  • Data = unknown

    Type of data sent to the worker. This can only be structured-cloneable data.

  • Response = unknown

    Type of execution response. This can only be structured-cloneable data.

Type declaration

    • (data?): Promise<Response>
    • Parameters

      • Optional data: Data

        Data sent to the worker.

      Returns Promise<Response>

Returns

Execution response promise.