Function: State()
function State<This, Value>(target: undefined, context: ClassFieldDecoratorContext<This, Value>): (this: This, initialValue: Value) => Value;
Defined in: src/reactivity/decorators/state.ts:13
Type Parameters
| Type Parameter |
|---|
This extends object |
Value |
Parameters
| Parameter | Type |
|---|---|
target |
undefined |
context |
ClassFieldDecoratorContext<This, Value> |
Returns
(this: This, initialValue: Value): Value;
Parameters
| Parameter | Type |
|---|---|
this |
This |
initialValue |
Value |
Returns
Value
State
es un decorador para campos de clase que los convierte en señales reactivas. Automáticamente detecta el tipo de valor y crea la señal apropiada:
- Primitivos (string, number, boolean, etc.) → Signal
- Objetos → CompositeSignal con Proxy para sintaxis nativa
- Arrays → ReactiveArray con Proxy para sintaxis nativa