initial commit

This commit is contained in:
Art Lowel
2016-11-30 15:13:29 +01:00
commit a573556963
50 changed files with 2161 additions and 0 deletions

17
src/backend/cache.ts Normal file
View File

@@ -0,0 +1,17 @@
var _fakeLRUcount = 0;
export const fakeDemoRedisCache = {
_cache: {},
get: (key) => {
let cache = fakeDemoRedisCache._cache[key];
_fakeLRUcount++;
if (_fakeLRUcount >= 10) {
fakeDemoRedisCache.clear();
_fakeLRUcount = 0;
}
return cache;
},
set: (key, data) => fakeDemoRedisCache._cache[key] = data,
clear: () => fakeDemoRedisCache._cache = {}
};