Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tie FES initialization to only run just before p5 init #7173

Merged
merged 2 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/friendly_errors/sketch_reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,6 @@ if (typeof IS_MINIFIED !== 'undefined') {

p5._fesCodeReader = fesCodeReader;

window.addEventListener('load', p5._fesCodeReader);
window.addEventListener('p5Ready', p5._fesCodeReader);
}
export default p5;
3 changes: 3 additions & 0 deletions src/core/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ const _globalInit = () => {
}

if (!window.mocha) {
const p5ReadyEvent = new Event('p5Ready');
window.dispatchEvent(p5ReadyEvent);

// If there is a setup or draw function on the window
// then instantiate p5 in "global" mode
if (
Expand Down
Loading