sekoyo / keshi Goto Github PK
View Code? Open in Web Editor NEWA better in-memory cache for Node and the browser
A better in-memory cache for Node and the browser
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
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.
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.
Hi guys,
I'm working on Typescript environment.
Do you intend to create a declaration file?
Or Better if you should rewrite your package with Typescript.
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: [...] }
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.