@promises/filter-parallel
TypeScript icon, indicating that this package has built-in type declarations

0.5.0 • Public • Published

@promises/filter-parallel

Source Code Version MIT License Bundle Size

Filter Parallel is package from Promises library

Use

Module

$ npm install --save @promises/filter-parallel
import {
 default as filterParallel
} from '@promises/filter-parallel';

Browser

<script src="https://unpkg.com/@promises/filter-parallel/bundle.umd.min.js"></script>
let {
 filterParallel
} = P;

Examples

 let comparator = (value: number) => {
     return value % 2 === 0;
 };

 let array = Array.from({length:5}, (value, index) => index);

 filterParallel(array, comparator).then((result: number[])=>{
     console.log(result); // result => [0, 2, 4]
 });

Functional programming

Module

$ npm install --save @promises/filter-parallel
import {
 __,
 default as filterParallel
} from '@promises/filter-parallel/fp';

Browser

<script src="https://unpkg.com/@promises/filter-parallel/fp/bundle.umd.min.js"></script>
let {
 __,
 filterParallel
} = PF;

Examples

 let comparator = (value: number) => {
     return value % 2 === 0;
 };

 let array = Array.from({length:5}, (value, index) => index);

 filterParallel(comparator)(void 0, array).then((result: number[])=>{
     console.log(result); // result => [0, 2, 4]
 });

Wrapper

Module

$ npm install --save @promises/filter-parallel
import Promises from '@promises/core';
import '@promises/filter-parallel/add';

Or

import Promises from '@promises/filter-parallel/add';

Browser

<script src="https://unpkg.com/@promises/core/bundle.umd.min.js"></script>
<script src="https://unpkg.com/@promises/filter-parallel/add/bundle.umd.min.js"></script>
let {
 Promises
} = P;

Examples

 let comparator = (value: number) => {
     return value % 2 === 0;
 };

 let array = Array.from({length:5}, (value, index) => index);
 let promises = Promises.resolve(array);

 promises.filterParallel(comparator).then((result: number[])=>{
     console.log(result); // result => [0, 2, 4]
 });

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.

Package Sidebar

Install

npm i @promises/filter-parallel

Weekly Downloads

2

Version

0.5.0

License

MIT

Unpacked Size

125 kB

Total Files

39

Last publish

Collaborators

  • yisraelx