Skip to content

Commit 99ac55d

Browse files
authored
main preload->async/await
1 parent 080cd97 commit 99ac55d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/core/main.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ import * as constants from './constants';
1414
* a p5 sketch. It expects an incoming sketch closure and it can also
1515
* take an optional node parameter for attaching the generated p5 canvas
1616
* to a node. The sketch closure takes the newly created p5 instance as
17-
* its sole argument and may optionally set <a href="#/p5/preload">preload()</a>,
18-
* <a href="#/p5/setup">setup()</a>, and/or
19-
* <a href="#/p5/draw">draw()</a> properties on it for running a sketch.
17+
* its sole argument and may optionally set an asynchronous function
18+
* using `async/await`, along with the standard <a href="#/p5/setup">setup()</a>,
19+
* and/or <a href="#/p5/setup">setup()</a>, and/or <a href="#/p5/draw">draw()</a>
20+
* properties on it for running a sketch.
2021
*
2122
* A p5 sketch can run in "global" or "instance" mode:
2223
* "global" - all properties and methods are attached to the window
@@ -465,6 +466,8 @@ for (const k in constants) {
465466
* <a href="#/p5/draw">draw()</a> begins looping. If the
466467
* <a href="#/p5/preload">preload()</a> is declared, then `setup()` will
467468
* run immediately after <a href="#/p5/preload">preload()</a> finishes
469+
*
470+
*
468471
* loading assets.
469472
*
470473
* Note: `setup()` doesn’t have to be declared, but it’s common practice to do so.

0 commit comments

Comments
 (0)