Sykander / iterable-async

Iterable Async Methods
https://www.npmjs.com/package/iterable-async
MIT License
5 stars 0 forks source link

Add Map Sort Specs #69

Closed Sykander closed 4 years ago

Sykander commented 4 years ago

Inspiration https://github.com/Pimm/mapsort

This is because async functions will normally be calls to an external api and so mapSort is highly preferable over just sort when the compare function is asynchronous.

Implementation of this function is

mapSort( async (element, index, array) => { // return item ideal for sorting here }, async (a, b) => { // return comparison between items here after performing ideal sort map } )

Sykander commented 4 years ago
function asyncMap(async function mappingFunction, [async function comparisonFunction=compareByUnicode]) {
  // ...
}

function asyncMapIterable(Object iterable, async function mappingFunction, [async function comparisonFunction=compareByUnicode]) {
  // ...
};
Sykander commented 4 years ago

85