Closed yjbanov closed 6 years ago
Found an issue while using this locally:
If there is no event associated with a setState call, then renderFrame never gets called. potential modification is to remove the root event listener in the Tree and instead call this after setState somehow.
Ideally multiple calls to setState won't call renderFrame
multiple times. Something like this:
bool _isRendering = false;
void scheduleUpdate() {
if (!_isRendering) {
_isRendering = true;
scheduleMicrotask(() {
tree.renderFrame();
_isRendering = false;
});
}
}
Good catch. Should it be a microtask or requestAnimationFrame
?
requestAnimationFrame
makes more sense to me since we can more easily batch an update across the entire app
Yes! Travis works again!
This PR ditches package:js in favor or dart:html