feat: add hot reloading support

This commit is contained in:
Dominik Pschenitschni 2022-09-21 22:45:11 +02:00
parent f7ca064127
commit 1c58fccd92
No known key found for this signature in database
GPG key ID: B257AC0149F43A77
2 changed files with 12 additions and 2 deletions

View file

@ -1,4 +1,4 @@
import { defineStore } from 'pinia' import { acceptHMRUpdate, defineStore } from 'pinia'
import LabelService from '@/services/label' import LabelService from '@/services/label'
import {success} from '@/message' import {success} from '@/message'
@ -134,3 +134,8 @@ export const useLabelStore = defineStore('label', {
}, },
}, },
}) })
// support hot reloading
if (import.meta.hot) {
import.meta.hot.accept(acceptHMRUpdate(useLabelStore, import.meta.hot))
}

View file

@ -1,5 +1,5 @@
import {watch, reactive, shallowReactive, unref, toRefs, readonly} from 'vue' import {watch, reactive, shallowReactive, unref, toRefs, readonly} from 'vue'
import {defineStore} from 'pinia' import {acceptHMRUpdate, defineStore} from 'pinia'
import {useI18n} from 'vue-i18n' import {useI18n} from 'vue-i18n'
import ListService from '@/services/list' import ListService from '@/services/list'
@ -179,4 +179,9 @@ export function useList(listId: MaybeRef<IList['id']>) {
list, list,
save, save,
} }
}
// support hot reloading
if (import.meta.hot) {
import.meta.hot.accept(acceptHMRUpdate(useListStore, import.meta.hot))
} }