mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
14 lines
277 B
TypeScript
14 lines
277 B
TypeScript
import WebStorageCache from 'web-storage-cache'
|
|
|
|
type CacheType = 'sessionStorage' | 'localStorage'
|
|
|
|
export const useCache = (type: CacheType = 'localStorage') => {
|
|
const wsCache: WebStorageCache = new WebStorageCache({
|
|
storage: type,
|
|
})
|
|
|
|
return {
|
|
wsCache,
|
|
}
|
|
}
|