fix migration example
This commit is contained in:
parent
6dd9394fef
commit
dc3d5f8494
2 changed files with 8 additions and 6 deletions
|
|
@ -635,11 +635,13 @@ greetAsync()
|
|||
### `v1.x`
|
||||
|
||||
```javascript
|
||||
var greetAsync = new Promise(function(resolve){
|
||||
setTimeout(function() {
|
||||
resolve("hello")
|
||||
}, 1000)
|
||||
})
|
||||
var greetAsync = function() {
|
||||
return new Promise(function(resolve){
|
||||
setTimeout(function() {
|
||||
resolve("hello")
|
||||
}, 1000)
|
||||
})
|
||||
}
|
||||
|
||||
greetAsync()
|
||||
.then(function(value) {return value + " world"})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue