I stumbled upon code examples where ionic components wrap around pure javascript libraries that need their valuies updated. This is performed using requestAnimationFrame
, e.g. like this:
let startRequest = this._last == null;
this._last = { value: value, unit: unit };
if (startRequest) {
requestAnimationFrame(() => {
let last = this._last;
this._last = null;
this.update(last.value, last.unit);
});
}
Besides the performance issue described here I wonder whether this is the recommended way to go or if there are other machnisms to use here.
Please comment.