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: apps/components_guide_web/lib/components_guide_web/templates/web_standards/promise.html.md
+61-4Lines changed: 61 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,63 @@
1
-
# Promise
2
-
3
-
You can think of a Promise as a value. Once a Promise has been created, you can’t changed the value. Sooner or later its value will be given — as promised. (Or it may fail with an error. More on that later.)
1
+
# Thinking about Promises
2
+
3
+
## Promises act as values
4
+
5
+
You can think of a Promise as an eventual value. It either succeeds with a particular success value, or it possibly fails with an error value.
<div>✅ Rejected with <div class="px-2 text-white bg-orange-700 border-4 border-orange-900 rounded">Error</div></div>
33
+
</div>
34
+
</div>
35
+
36
+
Once a Promise has receive its value, you can’t changed that value. If it was told it failed, it can’t be changed to succeed instead. And if it succeeded, it can’t later fail.
37
+
38
+
## Chaining Promises
39
+
40
+
A Promise can create a _new_ Promise by calling `.then()` on it.
0 commit comments