Fix #1627
This commit is contained in:
parent
e7f38bb3e8
commit
43fca5898f
1 changed files with 7 additions and 5 deletions
|
|
@ -635,11 +635,13 @@ greetAsync()
|
||||||
### `v1.x`
|
### `v1.x`
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
var greetAsync = new Promise(function(resolve){
|
var greetAsync = function(){
|
||||||
setTimeout(function() {
|
return new Promise(function(resolve){
|
||||||
resolve("hello")
|
setTimeout(function() {
|
||||||
}, 1000)
|
resolve("hello")
|
||||||
})
|
}, 1000)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
greetAsync()
|
greetAsync()
|
||||||
.then(function(value) {return value + " world"})
|
.then(function(value) {return value + " world"})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue