Skip to content

Commit f0648d1

Browse files
authored
fixing as per suggestions
1 parent 7dbd554 commit f0648d1

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/core/reference.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,17 @@
11561156
* `loadImage()`, `loadJSON()`, `loadSound()`, and so on. This allows you to:
11571157
* - load files in a more readable, top-to-bottom manner
11581158
* - decide when the assets are fully available before proceeding
1159-
* - avoid nested callbacks often referred to as "callback hell"
1159+
*
1160+
* Nested callbacks require managing additional information and behavior.
1161+
* Lazy loading of assets with `async/await` can simplify control flow,
1162+
* but it also requires you to design your sketch around waiting for
1163+
* each operation to complete.
1164+
*
1165+
* Callbacks are still fully supported, so code that passes success / error
1166+
* functions to loaders like `loadImage()` or `loadJSON()` will behave exactly
1167+
* as it always has. This compatibility means sketches written with the older
1168+
* pattern don’t need any changes, and you can freely mix callbacks and
1169+
* `async/await` in the same project if that suits your workflow.
11601170
*
11611171
* In the example below, `setup()` is declared as an async function. We `await`
11621172
* the completion of both `loadImage()` and `loadJSON()` before calling

0 commit comments

Comments
 (0)