ValueListener
The ValueListener
type describes a function that is used to listen to changes to a Value
.
(
store: Store,
valueId: Id,
newValue: Value,
oldValue: Value,
getValueChange: GetValueChange | undefined,
): void
Type | Description | |
---|---|---|
store | Store | A reference to the |
valueId | Id | |
newValue | Value | The new value of the |
oldValue | Value | The old value of the |
getValueChange | GetValueChange | undefined | A function that returns information about any |
returns | void | This has no return value. |
A ValueListener
is provided when using the addValueListener
method. See that method for specific examples.
When called, a ValueListener
is given a reference to the Store
and the Id
of Value
that changed. It is also given the new value of the Value
, the old value of the Value
, and a GetValueChange
function that can be used to query Values
before and after the current transaction.
Note that if the listener was manually forced to be called (with the callListener
method rather than due to a real change in the Store
), the GetValueChange
function will not be present and the new and old values of the Value
will be the same.
Since
v3.0.0