-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Improve api typings * Remove unused proposal code in deploy-web * Enable noImplicitAny in tsconfig * Fix eslint errors * Add missing typing for axios calls * Remove eslint-disable-next-line * PR Fixes
- Loading branch information
Showing
34 changed files
with
304 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
import mcache from "memory-cache"; | ||
|
||
export default function MemoryCacheEngine() {} | ||
|
||
/** | ||
* Used to retrieve data from memcache | ||
* @param {*} key | ||
*/ | ||
MemoryCacheEngine.prototype.getFromCache = (key) => { | ||
const cachedBody = mcache.get(key); | ||
if (cachedBody) { | ||
return cachedBody; | ||
export default class MemoryCacheEngine { | ||
/** | ||
* Used to retrieve data from memcache | ||
* @param {*} key | ||
*/ | ||
getFromCache(key: string) { | ||
const cachedBody = mcache.get(key); | ||
if (cachedBody) { | ||
return cachedBody; | ||
} | ||
return false; | ||
} | ||
return false; | ||
}; | ||
|
||
/** | ||
* Used to store data in a memcache | ||
* @param {*} key | ||
* @param {*} data | ||
* @param {*} duration | ||
*/ | ||
MemoryCacheEngine.prototype.storeInCache = (key, data, duration) => { | ||
mcache.put(key, data, duration); | ||
}; | ||
/** | ||
* Used to delete all keys in a memcache | ||
*/ | ||
MemoryCacheEngine.prototype.clearAllKeyInCache = () => { | ||
mcache.clear(); | ||
}; | ||
/** | ||
* Used to delete specific key from memcache | ||
* @param {*} key | ||
*/ | ||
MemoryCacheEngine.prototype.clearAllKeyInCache = (key) => { | ||
mcache.del(key); | ||
}; | ||
/** | ||
* Used to store data in a memcache | ||
* @param {*} key | ||
* @param {*} data | ||
* @param {*} duration | ||
*/ | ||
storeInCache<T>(key: string, data: T, duration?: number) { | ||
mcache.put(key, data, duration); | ||
} | ||
/** | ||
* Used to delete all keys in a memcache | ||
*/ | ||
clearAllKeyInCache() { | ||
mcache.clear(); | ||
} | ||
/** | ||
* Used to delete specific key from memcache | ||
* @param {*} key | ||
*/ | ||
clearKeyInCache(key: string) { | ||
mcache.del(key); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.