Initializes a ReactiveProps instance with a given value.
The initial value of the ReactiveProps.
Optional
options: { Options.
The name of the ReactiveProps.
Private
#handlerPrivate
#proxyPrivate
#targetRetrieves the proxied value of the ReactiveProps. If the engine is destroyed, an error is thrown. Tracks the ReactiveProps for dependency management.
The proxied value of the ReactiveProps.
Sets the value of the ReactiveProps. If the value is an object, it will be proxied and reactive.
This is a synonym for set value(value)
.
The new value of the ReactiveProps.
True if the reactive item has been destroyed, false otherwise.
Retrieves the proxied value of the ReactiveProps. If the engine is destroyed, an error is thrown. Tracks the ReactiveProps for dependency management.
The proxied value of the ReactiveProps.
Sets the value of the ReactiveProps. If the value is an object, it will be proxied and reactive.
The new value of the ReactiveProps.
Private
#initChecks if two values are equal. If the compareFn property is a function, it is used to compare the two values. If the compareFn property is not a function, the values are compared using the === operator. If the optional second argument is not provided, the value of the reactive item is used.
The first value to compare.
Optional
b: anyThe second value to compare. If not provided, the value of the reactive item is used.
True if the two values are equal, false otherwise.
Retrieves the proxied value of the ReactiveProps. If the engine is destroyed, an error is thrown. Tracks the ReactiveProps for dependency management.
Optional
options: { Optional options. If untracked
is false
, the ReactiveProps value will be added to the getValueTracker.
Optional
untracked?: booleanThe proxied value of the ReactiveProps.
Returns true if there has been an error while calculating the value of the reactive item, false otherwise. This method returns true if the reactive item has been destroyed, if the reactive item has an error, or if the calculation of the value of the reactive item has thrown an error.
Whether there has been an error while calculating the value of the reactive item.
Subscribes a function to be called when the reactive item is destroyed. The function is called with no arguments.
The function to be called.
A function that unsubscribes the given function.
Subscribes a function to be called whenever a subscriber is added to the reactive item. The function is called with no arguments.
The function to be called.
A function that unsubscribes the given function.
Subscribes a function to be called whenever there are no longer any subscribers. The function is called with no arguments.
The function to be called.
A function that unsubscribes the given function.
Sets the value of the ReactiveProps. If the value is an object, it will be proxied and reactive.
The new value of the ReactiveProps.
Subscribes a function to be called whenever the value of this reactive item changes.
The function to be called whenever the value of this reactive item changes.
Optional
options: { Optional options.
The delay in milliseconds before the function is called.
The signal to abort the subscription.
ReactiveProps is a reactive primitive that holds a shallow object. It is the base unit of reactive state. It is a shallow reactive object, meaning that it only tracks changes to the properties of the object itself, not its nested properties.
Example
Example