useVideoSubjects.js 437 B

1234567891011121314
  1. import {ref, onMounted} from 'vue'
  2. import {cacheActions} from "@/hooks/defineCacheActions";
  3. import {useCacheStore} from "@/hooks/useCacheStore";
  4. export const useVideoSubjects = function () {
  5. const subjects = ref([])
  6. const {dispatchCache} = useCacheStore()
  7. onMounted(async () => {
  8. subjects.value = await dispatchCache(cacheActions.getVideoSubjects)
  9. })
  10. return {subjects, keyName: 'label', keyValue: 'code'}
  11. }