toolness / p5.js-widget

A reusable widget for embedding editable p5 sketches in web pages.
https://toolness.github.io/p5.js-widget/
GNU Lesser General Public License v2.1
161 stars 44 forks source link

Preview can potentially misbehave if unmounted early #5

Closed toolness closed 8 years ago

toolness commented 8 years ago

See:

https://github.com/toolness/p5.js-widget/blob/master/lib/preview.tsx#L57-L63

toolness commented 8 years ago

Hmm, I'm actually not convinced this is a bug. Because the callback is executed in the context of an event listener on an iframe, it won't (AFAIK) be called if the iframe is removed from the DOM, which will happen when the preview is unmounted.

toolness commented 8 years ago

Ok, I'm pretty sure this isn't a bug, so I left a comment in the code saying as much, and will close this now.