mirror of
https://github.com/onkelbeh/cheatsheets.git
synced 2026-08-15 13:34:53 +02:00
Bluebird: fix Promise.try
This commit is contained in:
@@ -40,10 +40,14 @@ Promise.props({
|
||||
### Chain of promises
|
||||
|
||||
```js
|
||||
Promise.try(function () {
|
||||
function getPhotos() {
|
||||
return Promise.try(function () {
|
||||
if (err) throw new Error("boo");
|
||||
return result;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
getPhotos().then(...)
|
||||
```
|
||||
|
||||
### Working with node-style functions
|
||||
|
||||
Reference in New Issue
Block a user