whenStable method
Registers callback
to be invoked when change detection is completed.
The parameter, didAsyncWork
, is true
when invoked as a result of
change detection being complete, and false
if, upon registration, the
app was already stable, triggering the callback
.
This is commonly referred to as stable, that-is that the DOM representation of the app is synchronized with the Dart data and template models, and no more changes are (currently) epected.
Implementation
void whenStable(void Function(bool didAsyncWork) callback) {
// TODO(b/168535057): Change this to `void Function()` instead.
_storeCallback(callback);
_runCallbacksIfStable(false);
}