npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@teamteanpm2024/sequi-molestias-recusandae

v1.0.5

Published

Combine async iterators into an object that conforms to the[async iterable and async iterator protocol](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols).

Downloads

11

Maintainers

shivamkalsi2024shivamkalsi2024

Keywords

textbannerframerdataviewhashassertsjsonpathslotES7Function.prototype.namefind-upprototypelengthfindLastsorteduuidio-tsstylingRxJSargvxhrconfigurableeventsArray.prototype.findLastIndexwriteReactiveXsigintObjectproxywhichcloudtrailrecursivecode pointseverycompilerutilitiesPromisestructuredCloneparentdomECMAScript 2023genericsregular expressionshandlerscharactersajaxCSSStyleDeclarationtyped arrayjsonschemaECMAScript 3streamdateBigUint64ArraynodeexitmonoreposetlesscssstylesheetelasticacheesfastcopyprocessmixinsstarterframeworkWebSocketsshrinkwrapinputvarInt32ArrayauthenticationaccessorRxindicatorebswatching3dtesterwordbreakpropertyswfES2016intrinsicreadtypeofawsarraybcryptshellkoreanfullwidthkarmaeventEmitterArray.prototype.includesutilrobustRegExp#flags$.extendsymbolflattentypesbeanstalki18npropcollection.es6momentremoverangeerrortostringtagwarningincludesstylesArray.prototype.flattenbyteLengthcolorsvalidhasOwnPropertycloudsearchimportarraybuffererrorcloudfrontECMAScript 2022trimStartinstallersuperagentdataViewchaicloudwatchownimportexportdotenvdayjssetPrototypeOfeventDispatcherthroatcore-0reducermatchendertakeJSON-Schemalistenersconsolebrowserlistpreserve-symlinkspasswordES2018visualrm -frenvfunctionalwebstringifier6to5springtelephoneECMAScript 5libphonenumberobjcss-in-jsescapebuffertypesafecompile lessqsdeepsymbolscontainssameValueZerowafinternal slotfastifysesexpresscss nestingresolvewatchFilerfc4122environmentaccessibilityless cssreact-hook-formreusecommandperformancecliInt8Arrayfigletinternalspinnersbusyprotoconcurrencyvestdebugrequestdircomputed-typescloudformationpushES2023autoprefixerpnpm9JSONjwtlockfilephonejsoncsses2017Object.valuesArray.prototype.flatMaptypeerrorendpointtypedarrayform-validationparentswritableES2021file systembluebirdmochavariables in cssassertionerror-handlingsnsobjectworkflowWeakSetargumentlimitedjavascript.envhelpersES3fetchreadablermdirwalkjson-schema-validationsqses2015asyncextendYAMLsigtermconcatECMAScript 2016collectionzodformvalidationStreamECMAScript 2020emitloadingloggerarktypemetadatafull-widthregexpiamRegExp.prototype.flagsinvariantqueueprivatewatches6pluginES8fast-copygroupBypersistentmkdirpgetoptelbqueueMicrotaskless mixinsbddchinesefulldynamodbObject.issortmime-dbweaksetimmerdeletetypedes5fasttrimLeftunicodeshimeslintpluginutil.inspectlruchromelazysequencetoolkitdeep-clonewindowsmobileawesomesauceless compilerinbundlerpackage managerinferenceinspectassertcryptcloneloggingtypescriptgetOwnPropertyDescriptorlintrmTypeScriptrdscolourtranspileUnderscoredirectoryweakmapbytepromisecall-boundObservablereducelookcoerciblepicomatchbrowsersignalregularestreeequalityflatMapArrayBuffer#sliceArrayBuffer.prototype.slicecallbindjoiserializetsexpressiondependency managerfromserializersignalscurriedutilsfindLastIndextoSortedwaititerationTypeBoxECMAScript 6tacitObservablesratesettingsES2017mruprivate dataparserargparseES2020mimetypesdescriptorglacierscheme-validationviewfprm -rfjsxstatusbatcheslintpositivejQueryvaluesstringclassnamescommanderguidnegativefunctionsjasminelinkquerystringdatagroupfunctionBigInt64ArraysideObject.assigntapagentformattingconsttypedarrayswhatwgdeep-copypackagesconnectjapaneseavasomeencryptionbindpopmotionflatfswatcheroutputflagelectronhigher-orderoptimizercreatehooksdiffmatchestypanionCSSwalkingURLmatchAlles-abstractschemefast-deep-copyes2018astSymbolbreakpureajvUint8Arraypackage.jsonec2optimistpyyamlupinstallbabeltrimEndurlfseventsmulti-packagetslibconsumereal-timespecObject.definePropertyless.jsstyleguidenameArray.prototype.containsopenpreprocessorhasworkspace:*String.prototype.matchAlloffsetRFC-6455quotecall-bindsearchgetternopelimittypemakefoldermergejsdiffObject.keyscolumnstddutilitypatchteststoragegatewayequalgradients css3Int16Arrayfast-clonewaapi0wordwrapmacosvaluetermECMAScript 2015gdprspinneres8letclass-validatordefinePropertyimmutablebootstrap cssIteratorratelimitObject.entriespackageES6ECMAScript 2018argscore-jsMapreact-testing-librarytoobjecttrimzeroautoscalingtimemkdirsinterruptsforEachfindupharmonysliceshareddeepclonedatastructureruntimecomparesetterstableassignglobecmascriptserializationoptionvariableslinewrapReflect.getPrototypeOfroute53WebSocketregexansiperformantdefinedebuggertc39filekeyssimpledbhasOwnamazonfindemojiarttoArraysyntaxkinesisminimalStyleSheetrequirenamessetImmediateFloat32ArraycensorextraidleAsyncIteratora11ynodejsjsdomsymlinksReactiveExtensionsFloat64Arraydescriptorsexit-codepruneyamlcorsshebangpipeESformsECMAScript 2021modulessafeirqes7chromiummapreducelanguageMicrosoftmoduletouchl10nregular expressioniteratorlinuxprettystyleawaitcheckString.prototype.trimentriesarraysparsebootstrap lessbabel-coreES2019_.extendcharacterstreamsmiddlewaretaskcircularreadablestreamlastStreamsuser-streamsonceshamhttpssanitizecallbackpostcsscss lessmimeredux-toolkitisConcatSpreadabletranspilerECMAScript 2019posedeepcopyomitsyntaxerrorpostcss-pluginECMAScript 7yupnpmstringifyArray.prototype.findLastexecES2015symlinkfixed-widthcalltraversethreeHyBiWeakMapquerys3animationiterateprefixbuffers@@toStringTagefficientcodespromisesstatelessramdaES2022apifastclonelessArrayBufferjson-schemavpcmkdir256gradients cssreact-hooksdropUint32ArraymapES5enumerablecurlECMAScript 2017path__proto__columnPushtestinggetes-shimsrandomprotocol-buffershas-owncopyreactes2016browserslisttoStringTagbyteOffsetstreams2jsArraypropertiesboundprotobufbalancedtrimRightasciiwrapconcatMaploadbalancingcryptonegative zerodescriptionisvalidatorcjkeslintconfigairbnbArray.prototype.flatUint16Arrayextensionbundlingflagsauthnativeprogressparsingclassnamehttpstyled-componentscallboundURLSearchParams[[Prototype]]getintrinsiccss variablespeeduninstallhookformkeyvalidategetPrototypeOfthrottledependencies

Readme

@teamteanpm2024/sequi-molestias-recusandae

Combine async iterators into an object that conforms to theasync iterable and async iterator protocol.

Installation

npm i @teamteanpm2024/sequi-molestias-recusandae

AsyncIteratorsCombine

Yields an array (method: all or allSettled) or a single value (method: race or any) when the passed promise concurrency method returns a value. Return when the first async iterator returns (lazy: true) or return when the last async iterator returns (lazy: false)

new AsyncIteratorsCombine(
  iterable,
  {
    returnAsyncIterators = Array.from(iterable),
    method = 'all',
    lazy = false,
    initialValue = undefined,
  } = {}
)
  • iterable (required): AsyncIterator[]
  • options (optional): an object that has the following optional properties:
    • method: 'all', 'allSettled', 'race', 'any' (default: all)`
    • lazy: true, false (default: false)
      • Return when the the first async iterator returns or return when the last async iterator returns.
    • initialValue: any (default: undefined)
      • The initial value for an async iterator that has not yet yielded.
    • returnAsyncIterators: AsyncIterator[](default: all async iterators that are passed into iterable)
      • All async iterators that are passed into returnAsyncIterators are returned when the combined async iterator is returned.

CombineLatest

Yields an array of all latest yielded values for every async iterator. Start when the first async iterator yields (eager: true) or start when all async iterators have yielded (eager: false).

new CombineLatest(
  iterable,
  {
    returnAsyncIterators = Array.from(iterable),
    eager = false,
    lazy = false,
    initialValue = undefined,
  } = {}
)

Examples

import { AsyncIteratorsCombine } from '@teamteanpm2024/sequi-molestias-recusandae';

async function* generator1() {
  yield 1;
  yield 2;
  yield 3;
}

async function* generator2() {
  yield 'a';
  yield 'b';
  yield 'c';
  yield 'd';
  yield 'e';
}

const combination = new AsyncIteratorsCombine([generator1, generator2]);

for await (const output of combination) {
  console.log(output); // -> [1, 'a'], [2, 'b'], [3, 'c'], [3, 'd'], [3, 'e']
}

const combination2 = new AsyncIteratorsCombine([generator1, generator2], { lazy: true });

for await (const output of combination2) {
  console.log(output); // -> [1, 'a'], [2, 'b'], [3, 'c']
}
import { AsyncIteratorsCombine } from '@teamteanpm2024/sequi-molestias-recusandae';

async function* generator1() {
  await new Promise((resolve) => {
    setTimeout(resolve, 100);
  });
  yield 1;
  await new Promise((resolve) => {
    setTimeout(resolve, 100);
  });
  yield 2;
  await new Promise((resolve) => {
    setTimeout(resolve, 100);
  });
  yield 3;
}

async function* generator2() {
  await new Promise((resolve) => {
    setTimeout(resolve, 50);
  });
  yield 'a';
  await new Promise((resolve) => {
    setTimeout(resolve, 20);
  });
  yield 'b';
  await new Promise((resolve) => {
    setTimeout(resolve, 100);
  });
  yield 'c';
}

const combination = new AsyncIteratorsCombine([generator1, generator2], { method: 'race' });

for await (const output of combination) {
  console.log(output); // -> 'a', 'b', 1, 'c', 2, 3
}

const combination2 = new AsyncIteratorsCombine([generator1, generator2], {
  method: 'race',
  lazy: true,
});

for await (const output of combination2) {
  console.log(output); // -> 'a', 'b', 1, 'c'
}
import { CombineLatest } from '@teamteanpm2024/sequi-molestias-recusandae';

async function* generator1() {
  await new Promise((resolve) => {
    setTimeout(resolve, 100);
  });
  yield 1;
  await new Promise((resolve) => {
    setTimeout(resolve, 100);
  });
  yield 2;
  await new Promise((resolve) => {
    setTimeout(resolve, 100);
  });
  yield 3;
}

async function* generator2() {
  await new Promise((resolve) => {
    setTimeout(resolve, 50);
  });
  yield 'a';
  await new Promise((resolve) => {
    setTimeout(resolve, 20);
  });
  yield 'b';
  await new Promise((resolve) => {
    setTimeout(resolve, 100);
  });
  yield 'c';
}

const combination = new CombineLatest([generator1, generator2]);

for await (const output of combination) {
  console.log(output); // -> [1, 'a'], [1, 'b'], [1, 'c'], [2, 'c'], [3, 'c']
}

const combination2 = new CombineLatest([generator1, generator2], {
  eager: true,
});

for await (const output of combination2) {
  console.log(output); // -> [undefined, 'a'], [undefined, 'b'], [1, 'c'], [2, 'c'], [3, 'c']
}