fix(lib/assets/caches): remove useless async modifiers

This commit is contained in:
PalmDevs 2025-06-16 19:59:02 +07:00
parent cf3ded454d
commit 921d997230
No known key found for this signature in database
GPG key ID: 6FAE8F8677ACA8BA

View file

@ -18,8 +18,7 @@ const CacheStorage = getStorage<Cache>(`revenge/assets.${Key}`, {
})
// TODO(lib/assets/caches): This loads way too late and requires native interop to load earlier
// biome-ignore lint/complexity/useArrowFunction: Arrow functions are not supported
export const cached = CacheStorage.get().then(async function (cache_) {
export const cached = CacheStorage.get().then(cache_ => {
const cached = cache_ !== cache
// If we are not using the default value, merge it into the in-memory cache, then point the storage cache to the in-memory cache.
if (cached) {
@ -38,7 +37,7 @@ export interface Cache {
const save = debounce(() => CacheStorage.set({}), 1000)
export async function cacheAsset(asset: Asset, moduleId: Metro.ModuleID) {
export function cacheAsset(asset: Asset, moduleId: Metro.ModuleID) {
// Merge directly into the cache, only debouncing actual writes
mergeDeep(cache, {
[asset.name]: {
@ -46,5 +45,5 @@ export async function cacheAsset(asset: Asset, moduleId: Metro.ModuleID) {
},
})
await save()
save()
}