import {onMounted, ref} from 'vue'
import {useCacheStore} from "@/hooks/useCacheStore";
import {cacheActions} from "@/hooks/defineCacheActions";

export const useTopicSubjects = function () {
    const subjects = ref([])
    const {dispatchCache} = useCacheStore()

    onMounted(async () => {
        subjects.value = await dispatchCache(cacheActions.getSubjectList)
    })

    return {subjects, keyName: 'subjectName', keyValue: 'subjectId'}
}