npm package: @promises/map-series
Description: Map Series is package from Promises library
Author: Yisrael Eliev
Latest version: 0.5.0



# @promises/map-series
[![Source Code](https://img.shields.io/badge/%3C%2F%3E-source_code-blue.svg)](https://github.com/yisraelx/promises/blob/master/modules/map-series)
[![Version](https://img.shields.io/npm/v/@promises/map-series.svg)](https://www.npmjs.com/package/@promises/map-series)
[![MIT License](https://img.shields.io/npm/l/@promises/map-series.svg)](https://github.com/yisraelx/promises/blob/master/LICENSE)
[![Bundle Size](https://img.shields.io/bundlephobia/min/@promises/map-series.svg)](https://bundlephobia.com/result?p=@promises/map-series)

**Map Series is package from Promises library**

## Use

**Module**
```sh
$ npm install --save @promises/map-series
```
```typescript
import {
 default as mapSeries
} from '@promises/map-series';
```

**Browser**
```html
<script src="https://unpkg.com/@promises/map-series/bundle.umd.min.js"></script>
```
```typescript
let {
 mapSeries
} = P;
```


**Examples**
```typescript
 let mapper = (time: number) => {
     return timeout((resolve) => {
         resolve(index);
     }, time);
 };

 let count: number = 0;
 let array: number[] = [7, 1, 6, 9, 3];

 mapSeries(array, mapper).then((result: number[]) => {
     console.log(result); // result => [0, 1, 2, 3, 4]
 });
```


### Functional programming

**Module**
```sh
$ npm install --save @promises/map-series
```
```typescript
import {
 __,
 default as mapSeries
} from '@promises/map-series/fp';
```

**Browser**
```html
<script src="https://unpkg.com/@promises/map-series/fp/bundle.umd.min.js"></script>
```
```typescript
let {
 __,
 mapSeries
} = PF;
```


**Examples**
```typescript
 let mapper = (time: number) => {
     return timeout((resolve) => {
         resolve(index);
     }, time);
 };

 let count: number = 0;
 let array: number[] = [7, 1, 6, 9, 3];

 mapSeries(mapper, array).then((result: number[]) => {
     console.log(result); // result => [0, 1, 2, 3, 4]
 });
```


### Wrapper

**Module**
```sh
$ npm install --save @promises/map-series
```
```typescript
import Promises from '@promises/core';
import '@promises/map-series/add';
```
*Or*
```typescript
import Promises from '@promises/map-series/add';
```

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


**Examples**
```typescript
 let mapper = (time: number) => {
     return Promises.timeout((resolve) => {
         resolve(count++);
     }, time);
 };

 let count: number = 0;
 let array: number[] = [7, 1, 6, 9, 3];
 let promises Promises<number[]> = Promises.resolve<number[]>(array);

 promises.mapSeries(mapper).then((result: number[]) => {
     console.log(result); // result => [0, 1, 2, 3, 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](https://github.com/yisraelx),
Licensed under the [MIT license](https://github.com/yisraelx/promises/blob/master/LICENSE).