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:
12
bluebird.md
12
bluebird.md
@@ -40,10 +40,14 @@ Promise.props({
|
|||||||
### Chain of promises
|
### Chain of promises
|
||||||
|
|
||||||
```js
|
```js
|
||||||
Promise.try(function () {
|
function getPhotos() {
|
||||||
if (err) throw new Error("boo");
|
return Promise.try(function () {
|
||||||
return result;
|
if (err) throw new Error("boo");
|
||||||
});
|
return result;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
getPhotos().then(...)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Working with node-style functions
|
### Working with node-style functions
|
||||||
|
|||||||
Reference in New Issue
Block a user