Merge pull request #880 from vasilevx/patch-1

Fix function parameter
This commit is contained in:
Ilya Kantor 2019-04-02 08:52:23 +03:00 committed by GitHub
commit 7fa1bf7a96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -58,7 +58,7 @@ We can see two things by running the code above:
1. The executor is called automatically and immediately (by the `new Promise`).
2. The executor receives two arguments: `resolve` and `reject` — these functions are pre-defined by the JavaScript engine. So we don't need to create them. Instead, we should write the executor to call them when ready.
After one second of "processing" the executor calls `resolve("done")` to produce the result:
After one second of "processing" the executor calls `resolve("done!")` to produce the result:
![](promise-resolve-1.png)