refreshOptimization property

bool get refreshOptimization

Determines whether refresh optimization is enabled.

When set to true, the repository dynamically adjusts its update interval based on whether the most recent update actually changed the state:

  • No state change: The update interval increases exponentially (using a 1.5 growth factor) up to a maximum of 10× the base updateInterval. This minimizes redundant updates.
  • State change detected: The update interval resets to the base updateInterval for more frequent updates.

Additionally, if an update is triggered outside of the regular loop while refresh optimization is enabled, the interval resets to updateInterval.

Override this getter to return true if you want your repository to use this dynamic behavior.

Will be turned on in the future by default as the optimization algorithm is improved.

Implementation

bool get refreshOptimization => false;