We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b467200 + 5e040f9 commit f9fcff8Copy full SHA for f9fcff8
src/core/friendly_errors/sketch_reader.js
@@ -403,6 +403,6 @@ if (typeof IS_MINIFIED !== 'undefined') {
403
404
p5._fesCodeReader = fesCodeReader;
405
406
- window.addEventListener('load', p5._fesCodeReader);
+ window.addEventListener('p5Ready', p5._fesCodeReader);
407
}
408
export default p5;
src/core/init.js
@@ -25,6 +25,9 @@ const _globalInit = () => {
25
26
27
if (!window.mocha) {
28
+ const p5ReadyEvent = new Event('p5Ready');
29
+ window.dispatchEvent(p5ReadyEvent);
30
+
31
// If there is a setup or draw function on the window
32
// then instantiate p5 in "global" mode
33
if (
0 commit comments