0.5.0 • Published 6 years ago
@promises/reject-parallel v0.5.0
@promises/reject-parallel
Reject Parallel is package from Promises library
Use
Module
$ npm install --save @promises/reject-parallel
import {
default as rejectParallel
} from '@promises/reject-parallel';
Browser
<script src="https://unpkg.com/@promises/reject-parallel/bundle.umd.min.js"></script>
let {
rejectParallel
} = P;
Examples
let array: any[] = ['yes', null, 0, true];
rejectParallel(array).then((result: any[]) => {
console.log(result); // => [null, 0]
});
Functional programming
Module
$ npm install --save @promises/reject-parallel
import {
__,
default as rejectParallel
} from '@promises/reject-parallel/fp';
Browser
<script src="https://unpkg.com/@promises/reject-parallel/fp/bundle.umd.min.js"></script>
let {
__,
rejectParallel
} = PF;
Examples
let array: any[] = ['yes', null, 0, true];
rejectParallel(Boolean)(1)(array).then((result: any[]) => {
console.log(result); // => [null, 0]
});
Wrapper
Module
$ npm install --save @promises/reject-parallel
import Promises from '@promises/core';
import '@promises/reject-parallel/add';
Or
import Promises from '@promises/reject-parallel/add';
Browser
<script src="https://unpkg.com/@promises/core/bundle.umd.min.js"></script>
<script src="https://unpkg.com/@promises/reject-parallel/add/bundle.umd.min.js"></script>
let {
Promises
} = P;
Examples
let array: any[] = ['yes', null, 0, true];
let promises: Promises<any[]> = Promises.resolve(array);
promises.rejectParallel().then((result: any[]) => {
console.log(result); // => [null, 0]
});
Compatibility
These modules are written in typescript and available in ES5 and ES6 standard, the requirements are a global Promise (native or polyfill).
License
Copyright © 2017 Yisrael Eliav, Licensed under the MIT license.