scheduled static method
Implementation
static VoidCallback scheduled(VoidCallback callback) {
var targetVersion = 0;
var currentVersion = 0;
return () {
if (targetVersion == currentVersion) {
targetVersion++;
scheduleMicrotask(() {
targetVersion = ++currentVersion;
callback();
});
}
};
}