-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
This should be this.update() instead of this.render() to take advantage of the raf management yeah?
Lines 82 to 88 in 568c274
| _onload () { | |
| this.loaded = true | |
| this.onload() | |
| // if any listeners were attached in onload we trigger a rerender as state | |
| // may have changed between createElement or unload/load | |
| if (this[unloaders].length) this.render() | |
| } |
We should shadow bind this._reallyUpdate in the constructor since update could be called at a high frequency (e.g. some kind of animation loop that uses this.update() to render new frames.)
Lines 53 to 57 in 568c274
| update () { | |
| if (this[updating]) return | |
| this[updating] = true | |
| window.requestAnimationFrame(this._reallyUpdate.bind(this)) | |
| } |
Thoughts?
Metadata
Metadata
Assignees
Labels
No labels