Refactor into useLocalizedData

This commit is contained in:
BlossomiShymae
2024-10-14 19:02:06 -05:00
parent 793cd3e120
commit e956f7f6d1
15 changed files with 43 additions and 103 deletions

View File

@@ -1,13 +1,8 @@
<script setup lang="ts">
const { client } = useClient();
const { currentLocale } = useLocale();
const getRunes = async () => (await client.perks.listAsync({locale: currentLocale.value, version: "latest"}))
.sort((a, b) => a.id - b.id)
const runes = ref(await getRunes());
watch(currentLocale, async() => {
runes.value = await getRunes();
});
const { data: runes } = await useLocalizedData(async (x) => (await client.perks.listAsync({locale: x, version: "latest"}))
.sort((a, b) => a.id - b.id));
const { query, results } = useQueryable(runes, (x) => x.id, (x) => x.name);
</script>