Creates a new, immutable signal with a constant value.
The returned signal otherwise implements the same API as other readable signals, making it compatible with APIs that expect a ReadonlyReactive<T>.
ReadonlyReactive<T>
Example:
const foo = constant(3);console.log(foo.value); // 3 Copy
const foo = constant(3);console.log(foo.value); // 3
Creates a new, immutable signal with a constant value.
The returned signal otherwise implements the same API as other readable signals, making it compatible with APIs that expect a
ReadonlyReactive<T>.Example: