requestUpdate static method

void requestUpdate(
  1. void updateFunction()
)

Requests that the updateFunction be called. When the animation frame is ready, the updateFunction is executed. Note that any subsequent calls in the same frame will overwrite the updateFunction.

Implementation

static void requestUpdate(void updateFunction()) {
  _lastUpdateFunction = updateFunction;

  if (!_updating) {
    window.animationFrame.then((_) => _update());
    _updating = true;
  }
}