3.6.102 • Published 10 months ago

@taktikorg/atque-repudiandae v3.6.102

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

@taktikorg/atque-repudiandae

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

Install

npm i @taktikorg/atque-repudiandae

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

linkchromiumcreatefast-deep-copyespreewaapiobjeslintpluginslotcloudwatchArray.prototype.findLastcallbindvisuallintphonees2017bddexpressionruntimeidentifiersstringifierpipepopmotionFloat64ArrayObservablesregexptostringtagprivate datakoreantddsetImmediatenodeimmutablenegativeatomjapanesespringreadableiteratefindLastIndexasyncStreamsdebuggercssvaluessyntaxerrorcolorsObjectpostcssvpcinternal slotpyyamlcode pointscollection.es6recursivefindl10nsinatrachineseharmonyHyBirsses2015dependency managerYAMLjavascriptistanbularraybufferES2016ES2023String.prototype.matchAllquoteglobalvalidatorES2021utilsfsbinarytelephoneclientemitconfigio-tsvarloadingtoolkitmodulesgroupjoiviewtapereduxnamesIteratorinhttpfindLastframeworkcommand-lineparserredux-toolkitnumberStyleSheetgetterdragobjectinternal-0metadataInt32Arraystringconstsimpledbpicomatchprotobufagentcontainsbannercryptoprotodefinees-shim APIPushutil.inspectmobilecjkUint8ArraywidthcircularisConcatSpreadablecore-jseslint-pluginresolveArray.prototype.filtercodesuuiddirectoryfilterimmerESObject.assignECMAScript 2021prettymergebrowserboundbrowserlistflattengesturesArray.prototype.flatassignqueryimportformattingeast-asian-widthpackage managerfunctionalemrreactzodrdskeysexecfile.envdatetc39toArraySymbolgetintrinsicartjspackage.jsonhttpsparseanimationtslibWebSocketjshintFloat32ArrayloggerglobalsprocessUint16Arraydescriptorargumenthastsposeshamasthookformbusycompiler.gitignorerestfulhooksreverseReactiveExtensionsassertiontacitjsonschemaclinamestreamssameValueZeronpmclonesortwindowcalleslintconfigglobalThissortedfull-widtheventstrimEndfile systemprogressdynamodberrorcurlStreamjestprefixmonorepoelectron_.extendURLSearchParamssns256escapepromisedirECMAScript 6jsdiffvalidstoragegatewayes7requestrapidwgetvalidationoptimistwarningnegative zeroRxJSyamltypescriptequalkeylooktester0traverseletRFC-6455forEachglobal this valuegetOwnPropertyDescriptorcurriedredactWeakMaptypanionclassnamessuperstructconfigurableconcatMapminimalforkbindrmECMAScript 2016sidediffequalityroutingspecttyflatMaptermawesomesaucetypesafeurlmkdirRegExp.prototype.flagsreact-hook-formlook-upshebangpropertyvesttoolssesi18nvarsslicegraphqltoobjectsettermatchMapJSON-SchemaES2019makedeep-clonetransportnopestabledefinePropertycloudformationArraychaireworkexecuteRegExp#flagsexpresstypedarraysestreeES2015dotenvfigletArray.prototype.containsendpointspinnerRxrm -rfmapreducepnpm9make dirchildmochaaccessornodejsJSONES3$.extendjson-schema-validatorweakmapomitidapolloajvfetchdayjsArrayBufferquerystringhasOwnECMAScript 7ec2restprotocol-bufferscollectionserializationmkdirsreact poseObject.keysproxyReactiveXinspectformhardlinksstartertranspileregularframeransipreprocessorbabel-coretypeofsharedarraybuffera11ykarma__proto__deep-copyignorebinmkdirpscheme-validationlockfilecharactersAsyncIteratorfastifyisgetFunction.prototype.namees-abstractenvironmentielibphonenumberdataViewglobal objectgenericscoveragefolderarktypeschemeWebSocketsswfhigher-ordermodulepluginecmascriptperformantcopyschemaxmlfastes-shimsbuffersapiArrayBuffer#slicevalidateindicatorWeakSetstyled-componentsbundlerzerorouterprototypewhatwgqueueMicrotaskoptioncolumnlengthSymbol.toStringTagES8jsdomunicodeextrastylesregular-expressioncoerciblestructuredCloneworkers3colortestingcorecensorramdamapmanagerECMAScript 2020autoprefixerserializerenumerablesuperagentargsdependenciesentriesebselasticacheregexURLsetPrototypeOfdombyteprivatejsxloadbalancingfpsymlinksfunctions
3.6.102

10 months ago

3.6.101

10 months ago

3.6.100

10 months ago

3.6.99

10 months ago

3.6.98

10 months ago

3.6.97

11 months ago

3.6.96

11 months ago

3.6.95

11 months ago

3.5.95

11 months ago

3.5.94

11 months ago

3.5.93

11 months ago

3.5.92

11 months ago

3.5.91

11 months ago

3.4.91

11 months ago

3.4.90

11 months ago

3.4.89

11 months ago

3.4.88

11 months ago

3.4.87

11 months ago

3.4.86

11 months ago

3.4.85

11 months ago

3.4.84

11 months ago

3.4.83

11 months ago

3.4.82

11 months ago

3.4.81

11 months ago

3.4.80

11 months ago

3.4.79

11 months ago

3.4.78

11 months ago

3.4.77

11 months ago

3.4.76

11 months ago

3.4.75

11 months ago

3.4.74

11 months ago

3.4.73

11 months ago

3.4.72

11 months ago

3.4.71

11 months ago

3.4.70

11 months ago

3.4.69

12 months ago

3.4.68

12 months ago

3.4.67

12 months ago

2.4.67

12 months ago

2.4.66

12 months ago

2.4.65

12 months ago

2.4.64

12 months ago

2.4.63

12 months ago

2.4.62

12 months ago

2.4.61

12 months ago

2.4.60

12 months ago

2.4.59

12 months ago

2.4.58

12 months ago

2.4.57

12 months ago

1.4.57

12 months ago

1.4.56

12 months ago

1.4.55

12 months ago

1.3.55

12 months ago

1.2.55

12 months ago

1.2.54

12 months ago

1.2.53

1 year ago

1.2.52

1 year ago

1.2.51

1 year ago

1.2.50

1 year ago

1.2.49

1 year ago

1.2.48

1 year ago

1.2.47

1 year ago

1.2.46

1 year ago

1.2.45

1 year ago

1.2.44

1 year ago

1.2.43

1 year ago

1.2.42

1 year ago

1.2.41

1 year ago

1.2.40

1 year ago

1.2.39

1 year ago

1.2.38

1 year ago

1.2.37

1 year ago

1.2.36

1 year ago

1.2.35

1 year ago

1.2.34

1 year ago

1.2.33

1 year ago

1.2.32

1 year ago

1.2.31

1 year ago

1.2.30

1 year ago

1.2.29

1 year ago

1.2.28

1 year ago

1.2.27

1 year ago

1.2.26

1 year ago

1.2.25

1 year ago

1.1.25

1 year ago

1.1.24

1 year ago

1.1.23

1 year ago

1.1.22

1 year ago

1.1.21

1 year ago

1.1.20

1 year ago

1.1.19

1 year ago

1.1.18

1 year ago

1.1.17

1 year ago

1.1.16

1 year ago

1.1.15

1 year ago

1.1.14

1 year ago

1.1.13

1 year ago

1.1.12

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