Ticking Value
This class holds a value of type T and a Duration that indicates how much time needs to pass before recalculating value is required (i.e. how long since its production nextTick is valid for).
Note: this class purposefully does track the date/time when the value "expires", but simply provides a Duration indicating how long the value is valid for. It is a responsibility of callers to keep track when the value needs to be recomputed. For this reason, storing or transmitting this class via methods that require a significant delay (e.g. over a network) is not recommended.
Parameters
the value
after how much time the next value should be re-computed. null means that no more computations are needed.
Properties
Functions
Combines two different TickingValues.
Transforms this TickingValue using the transform function. The resulting TickingValue.nextTick will be the min of the two, see also withNextTickAtMost.
Transforms the TickingValue.value from this instance from type T to R using transform and returns a new TickingValue with it and the same TickingValue.nextTick.
Returns a TickingValue with the same TickingValue.value and with the next tick being the min of its value and nextTick.