import {injectLocal, provideLocal} from "@vueuse/core";

const key = Symbol('GlobalLoading')

export const useProvideGlobalLoading = function () {
    const loading = ref(false)
    const payload = {loading}
    provideLocal(key, payload)
    return payload
}

export const useInjectGlobalLoading = function () {
    return injectLocal(key)
}