Ninja Parading Musically

    ai-map

    1.2.0 • Public • Published

    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

    Install

    npm i ai-map

    DownloadsWeekly Downloads

    5

    Version

    1.2.0

    License

    MIT

    Last publish

    Collaborators

    • parroit