Skip to content

Commit af23ed0

Browse files
committed
Update docs about Promises/A+
1 parent b022298 commit af23ed0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,17 @@ async function foo(req,res) {
8181
}
8282
```
8383

84+
## Promises/A+ compliant support
85+
You never know what kind of promise you'll get from an external dependency. It can be from Bluebird, Babel polyfill or some other library. `on` should work with any promise object can `then`, such as the one provided by the popular [`bluebird`](https://github.com/petkaantonov/bluebird/) package:
86+
87+
```
88+
const {on} = require('await-on');
89+
const Bluebird = require('bluebird')
90+
91+
const fetchData = () => new Bluebird(/*...*/);
92+
const [err, data] = await on(fetchData());
93+
```
94+
95+
8496
## License
8597
MIT License. See [License](https://github.com/bitstrider/await-on/blob/master/LICENSE) in the repository.

0 commit comments

Comments
 (0)