diff --git a/docs/guide/walkthrough/services.md b/docs/guide/walkthrough/services.md index 5666cf004..fcb38bbc6 100644 --- a/docs/guide/walkthrough/services.md +++ b/docs/guide/walkthrough/services.md @@ -46,40 +46,39 @@ export default commandModule({ } // }) - ``` + ## Safety - Services cannot be called in other services while makeDependencies is forming. - You will need to wire dependencies together. -import Tabs from '@theme/Tabs';import TabItem from '@theme/TabItem'; +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; - -✅ A good example; + + ```ts title="index.ts" showLineNumbers -// index.ts -await makeDependencies(...pass you options here) +await makeDependencies(...pass your options here) ``` -```ts -// commands/ping.ts + +```ts title="commands/ping.ts showLineNumbers // This is guaranteed to be defined if configured correctly import { Service } from '@sern/handler'; const client = Service('@sern/client'); ``` - - -❌ Don't do this -```ts title="commands/ping.ts" showLineNumbers + + - + - Services can only be used after sern has made dependencies. - Calling a service before will crash your application.