theia-ide / sprotty

A next-gen web-based graphics framework
Apache License 2.0
138 stars 23 forks source link

[viewer] handle request animation frame in viewer #35

Closed JanKoehnlein closed 7 years ago

JanKoehnlein commented 7 years ago

Currently, we collect all commands for an animation frame in the action dispatcher to avoid multiple VDOM patches in a single frame.

In would make more sense to collect them in the viewer to perform only one update in a frame.

Make sure the new mechanism can be mocked / bypassed for tests which don't have window.requestAnimationFrame().

JanKoehnlein commented 7 years ago

Fixed by intoducing an ViewerCache and centralizing animation frame requests in the AnimationFrameSyncer.