The primary change that addresses the issue in #3 is that the beam update loop now happens asynchronously via setTimeout -- this allows the UI to update in between loops. Previously, it looped forever and the UI (and browser) would become unresponsive. The UI will now correctly show the beams colliding and updating as the infinite loop occurs, and the UI can still be interacted with, allowing users to make a move to break out of the loop.
This PR also contains a lot of other cleanup that was done as part of a larger refactoring which was eventually removed in favor of this simpler fix.
The primary change that addresses the issue in #3 is that the beam update loop now happens asynchronously via
setTimeout
-- this allows the UI to update in between loops. Previously, it looped forever and the UI (and browser) would become unresponsive. The UI will now correctly show the beams colliding and updating as the infinite loop occurs, and the UI can still be interacted with, allowing users to make a move to break out of the loop.This PR also contains a lot of other cleanup that was done as part of a larger refactoring which was eventually removed in favor of this simpler fix.