Bluebird: fix Promise.try

This commit is contained in:
Rico Sta. Cruz 2015-04-18 03:01:27 +08:00
parent e1fb322670
commit a0c77549bd
1 changed files with 8 additions and 4 deletions

View File

@ -40,10 +40,14 @@ Promise.props({
### Chain of promises
```js
Promise.try(function () {
if (err) throw new Error("boo");
return result;
});
function getPhotos() {
return Promise.try(function () {
if (err) throw new Error("boo");
return result;
});
}
getPhotos().then(...)
```
### Working with node-style functions