JSPM

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

An asynchronous, multiplexed iterable mapper

Package Exports

  • maplex
  • maplex/maplex.cjs
  • maplex/maplex.mjs

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 (maplex) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Maplex

A multiplexed mapper

I do a huge amount of work just via map/filter/reduce in js, but the one pattern that has never fit cleanly into this pattern is wanting to produce a single map output from many different parallel arrays, asynchronously (and thus, innately yeilding). This does that.

Usage

    import { Maplex } from 'maplex';
    // or
    const { Maplex } = require('maplex');
    Maplex.map(arrayA, ... arrayN, function(itemA, ... itemN){
        //do your work here and store it in finalItem
        return finalItem;
    }, function(result){
        //do something with your mapped value
    });

If you omit the completion function the results are not gathered, which is useful in streaming cases.

Testing

Just run mocha

Enjoy,

-Abbey Hawk Sparrow