mirror of
https://github.com/BlossomiShymae/clean-cuts.git
synced 2025-12-06 10:10:47 +01:00
Refactor into useLocalizedData
This commit is contained in:
@@ -1,13 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
const { client } = useClient();
|
||||
const { currentLocale } = useLocale();
|
||||
const getEmotes = async () => (await client.summonerEmotes.listAsync({locale: currentLocale.value, version: "latest"}))
|
||||
.sort((a, b) => a.id - b.id);
|
||||
|
||||
const emotes = ref(await getEmotes());
|
||||
watch(currentLocale, async() => {
|
||||
emotes.value = await getEmotes();
|
||||
});
|
||||
const { data: emotes } = await useLocalizedData(async (x) => (await client.summonerEmotes.listAsync({locale: x, version: "latest"}))
|
||||
.sort((a, b) => a.id - b.id));
|
||||
|
||||
const { query, paginate } = useQueryable(emotes, (x) => x.id, (x) => x.name);
|
||||
const pagination = paginate(100);
|
||||
|
||||
Reference in New Issue
Block a user