first commit
This commit is contained in:
32
resources/admin/support/cache.ts
Normal file
32
resources/admin/support/cache.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
export default class Cache {
|
||||
private static readonly prefix:string = 'catchadmin_'
|
||||
/**
|
||||
* set
|
||||
*
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
static set (key:string, value: any) : void {
|
||||
window.localStorage.setItem(Cache.prefix + key, value)
|
||||
}
|
||||
|
||||
/**
|
||||
* get
|
||||
*
|
||||
* @param key
|
||||
* @returns
|
||||
*/
|
||||
static get (key: string) : any {
|
||||
return window.localStorage.getItem(Cache.prefix + key)
|
||||
}
|
||||
|
||||
/**
|
||||
* delete
|
||||
*
|
||||
* @param key
|
||||
* @returns
|
||||
*/
|
||||
static del (key: string) : void {
|
||||
window.localStorage.removeItem(Cache.prefix + key)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user