diff options
| author | Fuwn <[email protected]> | 2026-04-14 18:19:54 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-04-14 18:19:54 -0700 |
| commit | f3ac4e6051d5b18c26d5a876ce12ddd1fd0f7107 (patch) | |
| tree | 8f54fc3fa12c70b21bf4bf421608c9b9400064da /src/lib/Media | |
| parent | fix(ui): balance homepage media panels (diff) | |
| parent | feat(cache): instant list revalidation from command palette and debug menu (diff) | |
| download | due.moe-f3ac4e6051d5b18c26d5a876ce12ddd1fd0f7107.tar.xz due.moe-f3ac4e6051d5b18c26d5a876ce12ddd1fd0f7107.zip | |
Merge pull request #3 from Fuwn/feat/instant-cache-invalidation
feat(cache): instant list revalidation from command palette and debug menu
Diffstat (limited to 'src/lib/Media')
| -rw-r--r-- | src/lib/Media/invalidate.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/Media/invalidate.ts b/src/lib/Media/invalidate.ts new file mode 100644 index 00000000..3a9ff067 --- /dev/null +++ b/src/lib/Media/invalidate.ts @@ -0,0 +1,18 @@ +import { browser } from "$app/environment"; +import { addNotification } from "$lib/Notification/store"; +import { options } from "$lib/Notification/options"; +import revalidateAnime from "$stores/revalidateAnime"; +import revalidateManga from "$stores/revalidateManga"; + +export const invalidateListCaches = () => { + if (!browser) return; + + revalidateAnime.update((n) => n + 1); + revalidateManga.update((n) => n + 1); + + addNotification( + options({ + heading: "Anime and manga list caches successfully invalidated", + }), + ); +}; |