Skip to content

computedAsync Type documentation

TypeScript declaration

import { computedAsync } from '@siemens/element-ng/markdown';

Computed value, but async. This exists because the resource() API is not suitable. During loading, the value changes to undefined. The proposed solution of resource snapshots and a withPreviousValue() function that uses resourceFromSnapshots() isn't suitable either because it's experimental.

Returns: readonly signal

computedAsync<T, R>(options: ComputedAsyncOptions<T, R>): Signal<T>

Computed value, but async. This exists because the resource() API is not suitable. During loading, the value changes to undefined. The proposed solution of resource snapshots and a withPreviousValue() function that uses resourceFromSnapshots() isn't suitable either because it's experimental.

Returns: readonly signal

Parameters

Types Documentation

import type { ComputedAsyncOptions } from '@siemens/element-ng/markdown';

Options for computedAsync()

Properties
  • Computation function. This is untracked(), params from the params function are passed

    computation : (params: R) => Promise<T>

  • Initial value of the computedAsync signal.

    initial : T

  • Params function, params will be passed to the computation function. This is tracked.

    params : () => R


Except where otherwise noted, content on this site is licensed under MIT License.