The function that returns the value of the Computed
Optional
options: { Options
A function that compares two values to determine if they are equal.
Whether the function is a hard function. If true, it prevents calling the function by comparing the string representation of the dependencies.
The name of Computed.
A new Computed instance with the given function and options.
const a = atom(0);
const b = computed(() => a.value + 1);
b.subscribe(() => {
console.log(b.value);
});
a.value = 1;
// b = 2
Creates a new Computed instance. Computed is a reactive primitive that holds a value that is computed from other reactive values.