import {useAp2iRequestService} from "~/composables/data/useAp2iRequestService";
import EnumManager from "~/services/data/enumManager";
import {useI18n} from "vue-i18n";

let enumManager:EnumManager | null = null

export const useEnumManager = () => {
    //Avoid memory leak
    if (enumManager === null) {
        const { apiRequestService } = useAp2iRequestService()
        const i18n = useI18n() as any
        enumManager = new EnumManager(apiRequestService, i18n)
    }
    return { enumManager: enumManager }
}
