Type Alias TaskAsyncFunction<Data, Response>

TaskAsyncFunction<Data, Response>: ((data?: 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

      • Optionaldata: Data

        Data sent to the worker.

      Returns Promise<Response>

      Execution response promise.