e22m4u 1 год назад
Родитель
Сommit
bf6c94a588
2 измененных файлов с 9 добавлено и 9 удалено
  1. 5 5
      README-ru.md
  2. 4 4
      README.md

+ 5 - 5
README-ru.md

@@ -45,7 +45,7 @@ const {Service} = require('@e22m4u/js-service');
 тот же метод `getService`, как если бы мы передавали
 сервис-контейнер между ними.
 
-## ServiceContainer
+### ServiceContainer
 
 Методы:
 
@@ -55,7 +55,7 @@ const {Service} = require('@e22m4u/js-service');
 - `use(ctor, ...args)` добавить конструктор и создать экземпляр
 - `set(ctor, service)` добавить конструктор и его экземпляр
 
-### get
+#### get
 
 Метод `get` класса `ServiceContainer` создает экземпляр
 полученного конструктора и сохраняет его для последующих
@@ -93,7 +93,7 @@ console.log(myDate2); // Wed Jan 01 2025 03:00:00
 console.log(myDate3); // Sun May 05 2030 03:00:00
 ```
 
-### Наследование
+#### Наследование
 
 Конструктор `ServiceContainer` первым параметром принимает родительский
 контейнер, который используется как альтернативный, если конструктор
@@ -114,7 +114,7 @@ const hasService = childContainer.has(MyService);
 console.log(hasService); // true
 ```
 
-## Service
+### Service
 
 Методы:
 
@@ -168,7 +168,7 @@ const app = new App();
 и его передачу между сервисами, так как эта логика
 инкапсулирована в классе `Service` и его методе `getService`
 
-### getService
+#### getService
 
 Метод `getService` обеспечивает существование единственного
 экземпляра запрашиваемого сервиса, а не создает каждый раз

+ 4 - 4
README.md

@@ -44,7 +44,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
+### ServiceContainer
 
 Methods:
 
@@ -54,7 +54,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
@@ -116,7 +116,7 @@ const hasService = childContainer.has(MyService);
 console.log(hasService); // true
 ```
 
-## Service
+### Service
 
 Methods:
 
@@ -171,7 +171,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