|
|
@@ -42,7 +42,7 @@ Moreover, if other services also inherit from the `Service` class,
|
|
|
they can refer to each other using the `getService` method,
|
|
|
as if we were passing the service container between them.
|
|
|
|
|
|
-## `ServiceContainer` class
|
|
|
+## `ServiceContainer`
|
|
|
|
|
|
Methods:
|
|
|
|
|
|
@@ -52,7 +52,7 @@ Methods:
|
|
|
- `use(ctor, ...args)` adds a constructor and creates its instance
|
|
|
- `set(ctor, service)` adds a constructor and its instance
|
|
|
|
|
|
-### get
|
|
|
+### `get`
|
|
|
|
|
|
The `get` method of the `ServiceContainer` class creates
|
|
|
an instance of the given constructor and saves it for next
|
|
|
@@ -114,7 +114,7 @@ const hasService = childContainer.has(MyService);
|
|
|
console.log(hasService); // true
|
|
|
```
|
|
|
|
|
|
-## `Service` class
|
|
|
+## `Service`
|
|
|
|
|
|
Methods:
|
|
|
|
|
|
@@ -169,7 +169,7 @@ a service container and passing it between services,
|
|
|
because this logic is encapsulated in the `Service`
|
|
|
class and its `getService` method.
|
|
|
|
|
|
-### getService
|
|
|
+### `getService`
|
|
|
|
|
|
The `getService` method ensures the existence of a single
|
|
|
instance of the requested service, rather than creating
|