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

0.5.0 • Public • Published

@promises/every-series

Source Code Version MIT License Bundle Size

Every Series is package from Promises library

Use

Module

$ npm install --save @promises/every-series
import {
 default as everySeries
} from '@promises/every-series';

Browser

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

Examples

 let comparator = (value: any) => {
     return Promise.resolve(Boolean(value));
 };

 let array: any[] = ['foo', true, Promise.resolve(-1)];

 everySeries(array, comparator).then((result: boolean)=>{
     console.log(result); // result => true
 });

Functional programming

Module

$ npm install --save @promises/every-series
import {
 __,
 default as everySeries
} from '@promises/every-series/fp';

Browser

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

Examples

 let comparator = (value: any) => {
     return Promise.resolve(Boolean(value))
 };

 let array: any[] = [true, 1, Promise.resolve(null), 'yes'];

 everySeries(comparator)(array).then((result: boolean)=>{
     console.log(result) // result => false
 });

Wrapper

Module

$ npm install --save @promises/every-series
import Promises from '@promises/core';
import '@promises/every-series/add';

Or

import Promises from '@promises/every-series/add';

Browser

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

Examples

 let comparator = (value) => {
     return Promises.resolve(Boolean(value));
 };

 let array: any[] = ['foo', true, Promises.resolve(-1)];
 let promises: Promises<any[]> = Promises.resolve(array);

 promises.everySeries(comparator).then((result: boolean)=>{
     console.log(result); // result => true
 });

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/every-series

Weekly Downloads

2

Version

0.5.0

License

MIT

Unpacked Size

115 kB

Total Files

39

Last publish

Collaborators

  • yisraelx