https://github.com/andreaspitzer/promise-spread
spread() for native ES6 Promises
https://github.com/andreaspitzer/promise-spread
Last synced: about 1 year ago
JSON representation
spread() for native ES6 Promises
- Host: GitHub
- URL: https://github.com/andreaspitzer/promise-spread
- Owner: andreaspitzer
- License: mit
- Created: 2016-02-04T08:59:58.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2020-05-23T12:07:02.000Z (about 6 years ago)
- Last Synced: 2025-06-12T18:16:31.998Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 17.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# promise-spread   
> `spread()` for native ES6 Promises
## Install
Install with [npm](https://www.npmjs.com/)
```sh
$ npm i promise-spread --save
```
## Usage
#### with `any-promise`
```js
var Promise = require('any-promise');
require('promise-spread')(Promise);
```
#### with native Promises
```js
require('promise-spread');
```
## Alternatives to using `spread()`
ES6 introduces [destructuring](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) and the [rest/spread operator](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Spread_operator), which eliminate the need for `spread` outright. ([Kris Kowal](http://stackoverflow.com/questions/22773920/can-promises-have-multiple-arguments-to-onfulfilled#comment34766222_22776850))
```javascript
.then(([a, b, c]) => {});
```
## Running tests
Install dev dependencies:
```sh
$ npm i -d && npm test
```
## Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/AndreasPizsa/promise-spread/issues/new).
## Author
**Andreas Pizsa**
+ [github/AndreasPizsa](https://github.com/AndreasPizsa)
+ [twitter/AndreasPizsa](http://twitter.com/AndreasPizsa)
Based on code by [Benjamin Gruenbaum](https://github.com/benjamingr)'s [answer on StackOverflow](http://stackoverflow.com/a/22776850/199263)
## License
Copyright © 2016 Andreas Pizsa
Released under the MIT license.
***
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on February 04, 2016._