Skip to content

Commit

Permalink
fix(package/cache): check if cached value is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
thelindat committed Sep 18, 2022
1 parent 2121472 commit 4657de6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package/shared/resource/cache/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ export const cache: Record<string, any> = new Proxy(
{
get(target, key: string) {
const result = key ? target[key] : target;
if (result) return result;
if (result !== undefined) return result;

AddEventHandler(`ox_lib:cache:${key}`, (value: any) => {
target[key] = value;
});

target[key] = exports.ox_lib.cache(key);
target[key] = exports.ox_lib.cache(key) || false;
return target[key];
},
}
Expand Down

0 comments on commit 4657de6

Please sign in to comment.