3.5.117 • Published 10 months ago

@patrtorg/enim-culpa v3.5.117

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@patrtorg/enim-culpa

A simple cache system for a single user request, built on the same concepts of data loader.

Install

npm i @patrtorg/enim-culpa

Usage

const { Factory } = require('.')
const factory = new Factory()

factory.add('fetchSomething', {
  // cache by default, set to false to just do batching
  cache: true
}, async (queries, context) => {
  console.log(queries)
  // [ 42, 24 ]

  console.log(context)
  // { some: 'data' }

  return queries.map((k) => {
    return { k }
  })
})

async function run () {
  const context = {
    some: 'data'
  }
  const cache = factory.create(context)

  const p1 = cache.fetchSomething(42)
  const p2 = cache.fetchSomething(24)

  const res = await Promise.all([p1, p2])

  console.log(res)
  // [
  //   { k: 42 },
  //   { k: 24 }
  // ]
}

run().catch(console.log)

If the query parameter is an object, its cache key will be generated using safe-stable-stringify.

License

MIT

takedirectoryownStreamsserializerlintArray.prototype.includeselectroneslintentriesdescriptorES3chromiumlengthspinnergitignoresetPrototypeOfcallbindloggerdeepclonepostcss-plugineslint-pluginajvwebSymbolES2020karmaquerytypedarraysfolderargumentworkflowbrowserlists3code pointsUint8ArrayES5function.lengthcoverageidledom-testing-librarytoArraypromisetranspileres-abstractparentswaapiimportexportArrayBuffer#slicedependenciesvpcmomentredacttypanioncollection.es6fpreduceeventDispatcherhtmlcolorsbrowserslistes-shimsoffsetstoragegatewaykoreanconfigshamnamerm -frnpmfantasy-landprettyES6real-timefixed-widthexecuteatomstringifyindicatorcore-jsreducerstylenopeAsyncIteratorreact posereversedprotoconcaturlsymlinkstypedcommandchanneltoReversedslicerangeerrornpmignoredefineHyBiboundcloudformationstablemergeArray.prototype.findLastinmatchcacheECMAScript 2016setImmediatetransformtrimRightcloneURLSearchParamsassertszodrestreact-testing-libraryschemePromise[[Prototype]]weakmaptranspileincludestostringtagECMAScript 2022util.inspectutilspyyamlrfc4122managerec2utillocationbinprotocol-buffersspringasterisksdataviewquerystringbddshellUnderscorergbsuperstructminimalaccessibilityenvhashreact-hook-formxtermfromfindupcurlfindLastintrinsicES2021es2018css-in-jsyuprework6to5CSSStyleDeclarationStreames8toStringTagcallbackcommand-lineprogressString.prototype.trimECMAScript 6recursivecsscomparetelephonekeyemojilocaltypeserror0ecmascriptjson-schema-validatorflatMaptestistanbulfastcopyES2019toSortedshimtestingprototypeESnexttrimLeftpolyfill256valuessafeenderlogbinaryasyncpositivecolourhasOwnObject.assignstructuredClonees2016toobjecthookformbufferstsMapio-tsclientdombabelimportramdadayjsrobustoptimisttddglobal this valuedeterministicyamldynamodbwhichtesterconcatMapswfi18ntypeofqueuejestsyntaxinstrumentationbabel-coresetconststylingparenttouches2015idArray.prototype.findLastIndexreadablestreamhelperArray.prototype.flatMapignoreextendcompilercharacterlooktrimEndexpressioneffect-tsECMAScript 3environmentsgesturesmkdirsloggingmetadatagetserializationamazonpnpm9ES2015call-boundrmdiridentifiersendpointObject.definePropertybusymakepackagejsxfigletObject.isl10ndependency managermobilepropmodulesbyteOffsetaccessorjQueryrestfulcurriedes-shim APIexecfilenegative zerotermArray.prototype.flattenfsa11yformattslibObjectpinoiteratortapgroupByjson-schema-validationvalidatechineseenumerableRegExp.prototype.flagsPushjsdifftypedarraysource mapasciiECMAScript 5TypeBoxtrimArrayBuffer.prototype.slicepoint-freegroupajaxfilteruninstallresolveruntimermhasRxJSiamtraverseschemaroutingstyled-componentsoutputWeakSetclassesgenericses7redirectforEachglacierwaitUint16Arrayeast-asian-widthhttpstypesafeweaksetlockfileECMAScript 2017codesnamesarraysairbnbhas-ownobjectastrequirehttpsymbolsfindpackage.jsonWebSocketsposeassertionredux-toolkitES2022workersortedcloudsearchperformanttoolkitcallboundBigUint64Arraycall-bindfunctionsregularuuidmapjsdomvalidletstreamprivate dataqsES2018shebangbytemkdirfull-widthjshintrouterconsolereadablebindrulesassertdescriptionbinariesarraybufferawesomesauceprotobufutilityfnmatchflatECMAScript 2023propertyspawnslotbundlerclass-validatorTypeScriptreduxapolloStyleSheetrssdeepdateparsersnshooksObservablelanguagestringspinnersregular expressionsdescriptorsperformancesqssimpledbtimeworkspace:*immutableemitautoprefixervestcharactersArray.prototype.containseveryframeragentunicodecopyInt16ArraypushString.prototype.matchAllfastifyes5lruwaf.gitignorenumberiepureharmonysearchfast-deep-copyimmerinvariantargvesappemrregexpfast-deep-cloneWebSocketguidfast-clonesymbolbufferhigher-ordervaluepopmotionsomees2017istypeerrorES8isConcatSpreadableSymbol.toStringTagmoduleformsttyglobalsflaglinkformfullloadingargsbeanstalkObject.getPrototypeOfregular expressionwritepatchformattingmatchesReactiveXfunctionRFC-6455commanderECMAScript 2015oncehasOwnProperty@@toStringTaginternalpostcssclassnameselfcensorgetintrinsicbannerdebugbrowserquotestarternegativehelpersprefixansireverseJSON-SchemaparseReactiveExtensionsmoveexpresscollectionUint32ArrayFloat64ArrayUint8ClampedArrayloadbalancingassignfastjsuser-streamsdeletecloudfrontiteratewalkingcontainseslintconfigfeedflattentoolsbundlinginstalltextcheckserializeIteratorviewjsonschemawidthvalidatorcomputed-typestypesubprocessfind-upinferencedropcolumnutilitiesmapreduce__proto__rdspropertiesfpsqueueMicrotaskprocessespreemake dirmulti-packageshrinkwrapconfigurablejoikeysmkdirpxmlrequestchromeclassnamesoptionreact animationproxygetOwnPropertyDescriptorgdprTypedArrayforkvalidationomitgetterpluginlook-upglobObject.fromEntriesJSON-0manipulationrm -rf
3.5.116

10 months ago

3.5.117

10 months ago

3.5.115

10 months ago

3.5.114

10 months ago

3.5.113

10 months ago

3.5.112

10 months ago

3.5.111

10 months ago

3.5.110

10 months ago

3.4.110

10 months ago

3.4.109

10 months ago

3.4.108

10 months ago

3.4.107

10 months ago

3.4.106

10 months ago

3.4.105

10 months ago

3.3.105

10 months ago

3.3.104

10 months ago

3.3.103

10 months ago

3.3.102

10 months ago

3.3.101

10 months ago

3.3.100

10 months ago

3.3.99

10 months ago

3.3.98

10 months ago

3.3.97

11 months ago

3.3.96

11 months ago

3.3.95

11 months ago

3.3.94

11 months ago

3.3.93

11 months ago

3.3.92

11 months ago

3.3.91

11 months ago

3.3.90

11 months ago

3.3.89

11 months ago

3.3.88

11 months ago

3.3.87

11 months ago

3.3.86

11 months ago

3.2.86

11 months ago

3.2.85

11 months ago

3.2.84

11 months ago

3.2.83

11 months ago

3.2.82

11 months ago

3.2.81

11 months ago

3.2.80

11 months ago

3.2.79

11 months ago

3.2.78

11 months ago

3.2.77

11 months ago

3.2.76

11 months ago

3.2.75

11 months ago

3.2.74

11 months ago

3.2.73

11 months ago

3.2.72

11 months ago

3.2.71

11 months ago

3.2.70

11 months ago

3.2.69

11 months ago

3.2.68

12 months ago

3.2.67

12 months ago

3.2.66

12 months ago

3.2.65

12 months ago

3.2.64

12 months ago

3.2.63

12 months ago

3.2.62

12 months ago

3.2.61

12 months ago

3.2.60

12 months ago

3.2.59

12 months ago

3.2.58

12 months ago

3.2.57

12 months ago

3.2.56

12 months ago

3.2.55

12 months ago

3.2.54

12 months ago

3.2.53

12 months ago

3.2.52

12 months ago

3.2.51

12 months ago

3.2.50

12 months ago

3.2.49

12 months ago

3.2.48

1 year ago

3.2.47

1 year ago

3.2.46

1 year ago

3.2.45

1 year ago

3.2.44

1 year ago

3.2.43

1 year ago

3.2.42

1 year ago

3.2.41

1 year ago

3.2.40

1 year ago

3.2.39

1 year ago

3.2.38

1 year ago

3.2.37

1 year ago

3.2.36

1 year ago

3.2.35

1 year ago

3.2.34

1 year ago

3.2.33

1 year ago

3.2.32

1 year ago

3.2.31

1 year ago

3.1.31

1 year ago

2.1.31

1 year ago

2.1.30

1 year ago

2.1.29

1 year ago

2.1.28

1 year ago

2.1.27

1 year ago

2.1.26

1 year ago

2.1.25

1 year ago

2.1.24

1 year ago

2.1.23

1 year ago

2.1.22

1 year ago

2.1.21

1 year ago

2.1.20

1 year ago

2.1.19

1 year ago

2.1.18

1 year ago

2.1.17

1 year ago

2.0.17

1 year ago

2.0.16

1 year ago

2.0.15

1 year ago

2.0.14

1 year ago

2.0.13

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago