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

const key = Symbol('MATH_JAX_SWITCH')

export const useProvideMathJaxSwitch = (disabled = false) => {
    const options = {disabled}
    provideLocal(key, options)
    return options
}

export const useInjectMathJaxSwitch = () => {
    // 默认是开放公式的，除非明确不会用到公式，否则不用主动注入该开关
    return injectLocal(key, {disabled: false})
}