Files
FloatingIsland/app/stores/pub.ts
2025-09-19 01:21:38 +08:00

17 lines
480 B
TypeScript

import { defineStore } from 'pinia'
import { ref } from 'vue'
import { useSolarNetwork } from '~/composables/useSolarNetwork'
import type { SnPublisher } from '~/types/api'
export const usePubStore = defineStore('pub', () => {
const publishers = ref<SnPublisher[]>([])
async function fetchPublishers() {
const api = useSolarNetwork()
const resp = await api('/publishers')
publishers.value = resp as SnPublisher[]
}
return { publishers, fetchPublishers }
})