@tempots/dom

Task() function

Represents a renderable task that can be executed asynchronously.

Signature:

Task: (task: () => Promise, options: TaskOptions | ((value: T) => TNode)) => Renderable

Parameters

Parameter

Type

Description

task

() => Promise

The asynchronous task to be executed.

options

TaskOptions | ((value: T) => TNode)

The options for the task or a function that transforms the task result into a renderable node.

Returns: Renderable

  • A function that renders the task and returns a cleanup function.