docs: Improve Loaders documentation (#5205)

This commit is contained in:
Shahed Nasser
2023-09-25 19:03:00 +03:00
committed by GitHub
parent 797cd48bd3
commit 07e65f5aba
3 changed files with 5 additions and 31 deletions
@@ -39,12 +39,12 @@ When the loader is defined in a module, it receives the following parameters:
For example, this loader function resolves the `ProductService` and logs in the console the count of products in the Medusa backend:
```ts title=src/loaders/my-loader.ts
import { ProductService } from "@medusajs/medusa"
import { ProductService, ConfigModule } from "@medusajs/medusa"
import { AwilixContainer } from "awilix"
export default async (
container: AwilixContainer,
config: Record<string, unknown>
config: ConfigModule
): Promise<void> => {
console.info("Starting loader...")
const productService = container.resolve<ProductService>(