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

const keyForm = Symbol('FORM_REF')

export const useProvideFormRef = function (formRef) {
    provideLocal(keyForm, {form: formRef})
    return formRef
}

export const useInjectFormRef = function () {
    return injectLocal(keyForm)
}