Creates a reactive state object. When the value property is modified, any dependent effects will be re-run.
value
The initial value of the state.
A proxy object wrapping the value.
const count = state(0);effect(() => console.log(count.value)); // Logs 0count.value++; // Logs 1 Copy
const count = state(0);effect(() => console.log(count.value)); // Logs 0count.value++; // Logs 1
Creates a reactive state object. When the
valueproperty is modified, any dependent effects will be re-run.