Computes a derived value based on other Readables.
The function that computes the value.
Optional
Optional custom Config.
An OwnedReadable that computes its value based on other Readables.
import { compute, writable, reactiveMap } from "@embra/reactivity";const v1$ = writable(0);const v2$ = writable(1);const map$ = reactiveMap([["s", 42]]);const sum$ = compute(get => get(v1$) + get(v2$) + get(map$).get("s") || 0); Copy
import { compute, writable, reactiveMap } from "@embra/reactivity";const v1$ = writable(0);const v2$ = writable(1);const map$ = reactiveMap([["s", 42]]);const sum$ = compute(get => get(v1$) + get(v2$) + get(map$).get("s") || 0);
Computes a derived value based on other Readables.