JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q33383F
  • License MIT

Map over async iterables

Package Exports

  • ai-map

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ai-map) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ai-map

Travis Build Status NPM downloads

Map over async iterables

The map() function creates a new async iterable with the results of calling a provided function on every element in the async iterable.

This module is part of Async iterable fun, a complete toolset of modules to work with async iterables.

Usage

description of the example

import aiMap from 'ai-map';

for (const item of {aiMap}()) {
  yield item;
};

This will output

API

index

Creates a new async iterable with the results of calling a provided function on every element in the async iterable.

Parameters

  • data AsyncIterable The async iterable to map over
  • transform Function Function to apply to each element in the async iterable, taking 3 arguments: . __currentValue__ - The current element being processed in the async iterable. __currentIndex__ - The index of the current element being processed in the async iterable. Starts at index 0 __data__ - The async iterable map was called upon.

Returns AyncIterable An iterable that iterates over the transform calls results.

with

Higher order function that partially apply transform to the map function.

Parameters

  • transform Function The transform argument to partially apply to map

Returns Function A map unary function that take a data argument and return a new async iterable.

Install

With npm installed, run

npm install --save ai-map

See Also

License

MIT Licensed © 2017 Andrea Parodi