Giter Site home page Giter Site logo

keshi's People

Contributors

dependabot[bot] avatar dominictobias-b1 avatar jumplink avatar sekoyo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

keshi's Issues

createCache argument should be optional

Hi guys,

I think createCache argument should be optional.

export interface Options {
  cleanupInterval?: Duration
  customStorage?: Storage
}
- declare const createCache: (options: Options) => Cache
+ declare const createCache: (options?: Options) => Cache

Cannot read property '1' of undefined

I am using this project everywhere to cache my API responses, however i had continous occurences of the below error after regular intervals. I am not sure what wrong i am doing.
Error : UnhandledPromiseRejectionWarning : TypeError: Cannot read property '1' of undefined at the file (keshi/src/indexjs:79:35).
Is there anything specific that needs to be done. I am using ASYNC function in Cache.resolve() with '30 mins' as the expires times.

AutoVacuum interval

Would be nice to be able to set an interval to auto-vacuum the cache, calling all isStale methods as available and removing all stale items from memory, in the case of node, if GC is available even forcing GC.

Pass key and set-ms to staleness function

It would be nice if the expiration resolver would be able to receive the key used for caching, and the dtm of when the value was placed in cache, in order to calculate and reference methods outside the cache directly.

await cache.resolve('foo', getFooAsync, isFooStale);
...
function isFooStale(key, dtm) {
  // key is the key passed into resolve
  // dtm is the valueOf for the date-time when an existing cached entry is first set
  // - maybe a high precision timer for node?  or { value: ms, precisionValue: [...] }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.