| 123456789101112131415 |
- import { useRepo } from 'pinia-orm'
- import EntityManager from '~/services/data/entityManager'
- import { useAp2iRequestService } from '~/composables/data/useAp2iRequestService'
- let entityManager: EntityManager | null = null
- export const useEntityManager = () => {
- if (entityManager === null) {
- const { apiRequestService } = useAp2iRequestService()
- const getRepo = useRepo
- entityManager = new EntityManager(apiRequestService, getRepo)
- }
- return { em: entityManager }
- }
|