Private
True if the reactive item has been destroyed, false otherwise.
Checks 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.
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.
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.
ReactivePrimitive is the base class for all reactive items. It provides methods for subscribing to changes, getting the current value, and checking for errors.