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

const key = Symbol('GlobalLoading')

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

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