main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
433 bytes
|
Line | |
---|
1 | import { map } from 'ramda';
|
---|
2 |
|
---|
3 | import allP from '../../allP';
|
---|
4 | import resolveP from '../../resolveP';
|
---|
5 |
|
---|
6 | const onFulfill = (value) => ({ status: 'fulfilled', value });
|
---|
7 | const onReject = (reason) => ({ status: 'rejected', reason });
|
---|
8 |
|
---|
9 | const allSettledPonyfill = (iterable) => {
|
---|
10 | const array = map(
|
---|
11 | (p) => resolveP(p).then(onFulfill).catch(onReject),
|
---|
12 | [...iterable]
|
---|
13 | );
|
---|
14 |
|
---|
15 | return allP(array);
|
---|
16 | };
|
---|
17 |
|
---|
18 | export default allSettledPonyfill;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.