3.5.117 • Published 11 months ago

@patrtorg/enim-culpa v3.5.117

Weekly downloads
-
License
MIT
Repository
github
Last release
11 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

11 months ago

3.5.117

11 months ago

3.5.115

11 months ago

3.5.114

11 months ago

3.5.113

11 months ago

3.5.112

12 months ago

3.5.111

12 months ago

3.5.110

12 months ago

3.4.110

12 months ago

3.4.109

12 months ago

3.4.108

12 months ago

3.4.107

12 months ago

3.4.106

12 months ago

3.4.105

12 months ago

3.3.105

12 months ago

3.3.104

12 months ago

3.3.103

12 months ago

3.3.102

12 months ago

3.3.101

12 months ago

3.3.100

12 months ago

3.3.99

12 months ago

3.3.98

12 months ago

3.3.97

12 months ago

3.3.96

12 months ago

3.3.95

12 months ago

3.3.94

1 year ago

3.3.93

1 year ago

3.3.92

1 year ago

3.3.91

1 year ago

3.3.90

1 year ago

3.3.89

1 year ago

3.3.88

1 year ago

3.3.87

1 year ago

3.3.86

1 year ago

3.2.86

1 year ago

3.2.85

1 year ago

3.2.84

1 year ago

3.2.83

1 year ago

3.2.82

1 year ago

3.2.81

1 year ago

3.2.80

1 year ago

3.2.79

1 year ago

3.2.78

1 year ago

3.2.77

1 year ago

3.2.76

1 year ago

3.2.75

1 year ago

3.2.74

1 year ago

3.2.73

1 year ago

3.2.72

1 year ago

3.2.71

1 year ago

3.2.70

1 year ago

3.2.69

1 year ago

3.2.68

1 year ago

3.2.67

1 year ago

3.2.66

1 year ago

3.2.65

1 year ago

3.2.64

1 year ago

3.2.63

1 year ago

3.2.62

1 year ago

3.2.61

1 year ago

3.2.60

1 year ago

3.2.59

1 year ago

3.2.58

1 year ago

3.2.57

1 year ago

3.2.56

1 year ago

3.2.55

1 year ago

3.2.54

1 year ago

3.2.53

1 year ago

3.2.52

1 year ago

3.2.51

1 year ago

3.2.50

1 year ago

3.2.49

1 year 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