1.1.5 • Published 11 days ago

@teamteanpm2024/pariatur-magni-recusandae v1.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
11 days ago

@teamteanpm2024/pariatur-magni-recusandae

Provides pipeAsync and traversePromises functions that play well with the rest of Ramda ecosystem. Now also plays "okish" with TypeScript.

Install

npm install @teamteanpm2024/pariatur-magni-recusandae

Example usage

import { pipeAsync, traversePromises } from '@teamteanpm2024/pariatur-magni-recusandae';
import { reduce, map, prop } from 'ramda';

pipeAsync(
  // string[] -> Promise<Response>[]
  map(fetch),
  // Promise<Response>[] -> Promise<Response[]>
  traversePromises,
  // Promise<Response[]> -> Promise<object>[]
  map(r => r.json()),
  // Promise<object>[] -> Promise<object[]>
  traversePromises,
  // Promise<object[]> -> Promise<number[]>
  map(prop('total_count')),
  // Promise<number[]> -> Promise<number>
  reduce((r, c) => r + c , 0),
)([
  "https://api.github.com/search/repositories?q=ramda",
  "https://api.github.com/search/repositories?q=react",
])
  // Prints total number of repositories found by two queries above
  .then(console.log);

You can run the example here

Api

pipeAsync(...steps)(initialValue)

Performs left-to-right function composition of all the steps, automatically lifts the initial value to a promise and pipes it through the composed steps.

traversePromises(arrayOfPromises)

Wraps the array of promises with Promise.all, so it traverses the types like this:

declare function traverse<A>(arrayOfPromises: Promise<A>[]): Promise<A[]>

Sponsor

This package is sponsored by ScreenManager - digital signage platform.

logauthentication__proto__immutableecmascriptURLglobserializechromiumsharedarraybufferuser-streamscryptguidObservablestakedeep-cloneformatcommanderlimitedmkdirpromisetrimisbundlerchannelprettydom-testing-libraryReactiveExtensionsweakmapopenfastifyES2019sameValueZeroawaitbytezodsuperagentmatchAllregular expressioncommandcode pointsObservabletoArraylazynodeoptimizerlintmatchECMAScript 2015protobufUint8Arrayformcommand-lineArraykeyrfc4122symlinksmake diriterationoutputschemadiff6to5waitESnextxhrparentssignalsunicodemkdirsviewlinewrapsimpledbdescriptorsworkerdirkeystypedserializerES2023gradients css3String.prototype.trimvalidvaluetoobjecttacitES2015Object.fromEntriesECMAScript 2019toolkitequalityterminalcall-boundregular expressionsomitwebsymbolJSON-Schemaajvtyped arrayrecursivewritepopmotionnegativesanitizeprotocol-bufferswrapimmersyntaxerrorjasminereadablestreammonorepofindLastprune-0entriesgroupfast-deep-clonewatcherwordbreaknativeReflect.getPrototypeOfhandlersrm -rfcss lessmrudependency manager0ECMAScript 2023WeakSetbusy_.extenddescriptionbcryptbyteLengthjsonpathECMAScript 2021css nestingemrgdprefficientansistylesbrowserslistcoerciblees2018koreancurlstringmimebalancederrorsomefileextendRxtranspilerpropertyvpccloudwatcheseslintpluginaccessorCSSStyleDeclarationcorewaapiworkflowstatelessvalidators3cachewarningjson-schema-validationwidthES7fastcopyECMAScript 7linkrdstoStringTagconsumees2016columnrapidargsfastsharedparsingexit-codeTypeScriptstylesheetrm -frUint16Array3dStyleSheetcollection.es6typanionfindLastIndexTypeBoxrequireWeakMapfast-deep-copyvarperformantconsolees7lockfilecolorasyncsortinternal slotArray.prototype.filterenvArray.prototype.flatMapietrimRightECMAScript 2020classnamedayjsoperating-systemtypecurriedRxJSlibphonenumbercompile lesseventEmitterproxyflagrgbECMAScript 2018connectUnderscoresetPrototypeOfcolorskarmacolourbindlimitshellcharactershigher-orderpackagesbundlingpropertiesSymbol.toStringTagES3cloudfrontfixed-widthclassesslicedescriptorconstfind-upawsvaluesfunctionES6requestjoihasOwnbootstrap lesssigintfetchECMAScript 5deletenumberreact posesanitizationregular
1.1.5

11 days ago

1.1.4

12 days ago

1.0.4

13 days ago

1.0.3

14 days ago

1.0.2

15 days ago

1.0.1

16 days ago

1.0.0

16 days ago