raphaelameaume / fragment

[alpha] A web development environment for creative coding
https://fragment.tools
MIT License
828 stars 19 forks source link

Prevent sketch update when loading #109

Closed raphaelameaume closed 7 months ago

raphaelameaume commented 7 months ago

This PR fixes an issue that would happen when using the load lifecycle function of a sketch. If a sketch is already running and load exists and takes some time, the previous render loop would be called even after destroying correctly the preview, which could lead to various issues.

This PR ensures that the sketch exists before calling the _renderSketch function.