/
dimamir
/
medusa
Обзор
Документация
Войти
/
dimamir
/
medusa
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
packages/modules/cache-inmemory/src/initialize/index.ts
23 строки
725 B
Adrien de Peretti
chore: Update modules deps (#9286)
26 сен 2024, 08:44
Не верифицирован
26 сен 2024, 08:44
e096feb
Код
Авторство
О чём код?
import { MedusaModule } from "@medusajs/framework/modules-sdk" import { ExternalModuleDeclaration, ICacheService, InternalModuleDeclaration, } from "@medusajs/framework/types" import { Modules } from "@medusajs/framework/utils" import { InMemoryCacheModuleOptions } from "../types" export const initialize = async ( options?: InMemoryCacheModuleOptions | ExternalModuleDeclaration ): Promise<ICacheService> => { const serviceKey = Modules.CACHE const loaded = await MedusaModule.bootstrap<ICacheService>({ moduleKey: serviceKey, defaultPath: "@medusajs//cache-inmemory", declaration: options as | InternalModuleDeclaration | ExternalModuleDeclaration, }) return loaded[serviceKey] }