You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/11-async/03-promise-chaining/article.md
+3-5Lines changed: 3 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -146,7 +146,7 @@ Returning promises allows us to build chains of asynchronous actions.
146
146
147
147
## Example: loadScript
148
148
149
-
Let's use this feature with the promisified `loadScript`, defined in the [previous chapter](/promise-basics#loadscript), to load scripts one by one, in sequence:
149
+
Let's use this feature with the promisified `loadScript`, defined in the [previous chapter](info:promise-basics#loadscript), to load scripts one by one, in sequence:
150
150
151
151
```js run
152
152
loadScript("/article/promise-chaining/one.js")
@@ -207,9 +207,7 @@ Sometimes it's ok to write `.then` directly, because the nested function has acc
207
207
208
208
209
209
````smart header="Thenables"
210
-
To be precise, `.then` may return an arbitrary "thenable" object, and it will be treated the same way as a promise.
211
-
212
-
A "thenable" object is any object with a method `.then`.
210
+
To be precise, `.then` may return a so-called "thenable" object - an arbitrary object that has method `.then`, and it will be treated the same way as a promise.
213
211
214
212
The idea is that 3rd-party libraries may implement "promise-compatible" objects of their own. They can have extended set of methods, but also be compatible with native promises, because they implement `.then`.
215
213
@@ -244,7 +242,7 @@ This feature allows to integrate custom objects with promise chains without havi
244
242
245
243
In frontend programming promises are often used for network requests. So let's see an extended example of that.
246
244
247
-
We'll use the [fetch](mdn:api/WindowOrWorkerGlobalScope/fetch) method to load the information about the user from the remote server. The method is quite complex, it has many optional parameters, but the basic usage is quite simple:
245
+
We'll use the [fetch](info:fetch) method to load the information about the user from the remote server. It has a lot of optional parameters covered in separate chapters, but the basic syntax is quite simple:
0 commit comments