diff --git a/package/shared/resource/cache/index.ts b/package/shared/resource/cache/index.ts index 59998df..acf0a6f 100644 --- a/package/shared/resource/cache/index.ts +++ b/package/shared/resource/cache/index.ts @@ -4,7 +4,7 @@ export const cache: Record = new Proxy( }, { get(target, key: string) { - let result = key ? target[key] : target; + const result = key ? target[key] : target; if (result) return result; AddEventHandler(`ox_lib:cache:${key}`, (value: any) => { @@ -17,6 +17,6 @@ export const cache: Record = new Proxy( } ); -export const onCache = (key: string, cb: (value: any) => void) => { +export const onCache = (key: string, cb: (value: T) => void) => { AddEventHandler(`ox_lib:cache:${key}`, cb); };