Skip to content

Commit da79c00

Browse files
authored
fix(part4b/README): correct broken link to callback hell explanation Replaced the invalid Stack Overflow link with a relevant and working answer: https://stackoverflow.com/a/25098230
1 parent d34c8f7 commit da79c00

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/content/4/en/part4b.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ Note.find({}).then(notes => {
397397

398398
The _Note.find()_ method returns a promise and we can access the result of the operation by registering a callback function with the _then_ method.
399399

400-
All of the code we want to execute once the operation finishes is written in the callback function. If we wanted to make several asynchronous function calls in sequence, the situation would soon become painful. The asynchronous calls would have to be made in the callback. This would likely lead to complicated code and could potentially give birth to a so-called [callback hell](http://callbackhell.com/).
400+
All of the code we want to execute once the operation finishes is written in the callback function. If we wanted to make several asynchronous function calls in sequence, the situation would soon become painful. The asynchronous calls would have to be made in the callback. This would likely lead to complicated code and could potentially give birth to a so-called [callback hell](https://stackoverflow.com/a/25098230).
401401

402402
By [chaining promises](https://javascript.info/promise-chaining) we could keep the situation somewhat under control, and avoid callback hell by creating a fairly clean chain of _then_ method calls. We have seen a few of these during the course. To illustrate this, you can view an artificial example of a function that fetches all notes and then deletes the first one:
403403

0 commit comments

Comments
 (0)