e22m4u 1 год назад
Родитель
Сommit
387777fc14
2 измененных файлов с 11 добавлено и 15 удалено
  1. 6 8
      README-ru.md
  2. 5 7
      README.md

+ 6 - 8
README-ru.md

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

+ 5 - 7
README.md

@@ -10,8 +10,6 @@ The «Service Locator» implementation for JavaScript.
 npm install @e22m4u/js-service
 npm install @e22m4u/js-service
 ```
 ```
 
 
-## Overview
-
 The module supports ESM and CommonJS standards.
 The module supports ESM and CommonJS standards.
 
 
 *ESM*
 *ESM*
@@ -26,7 +24,7 @@ import {Service} from '@e22m4u/js-service';
 const {Service} = require('@e22m4u/js-service');
 const {Service} = require('@e22m4u/js-service');
 ```
 ```
 
 
-### Purpose
+## Purpose
 
 
 The module offers `ServiceContainer` and `Service` classes,
 The module offers `ServiceContainer` and `Service` classes,
 which can be used separately or together.
 which can be used separately or together.
@@ -44,7 +42,7 @@ Moreover, if other services also inherit from the `Service` class,
 they can refer to each other using the `getService` method,
 they can refer to each other using the `getService` method,
 as if we were passing the service container between them.
 as if we were passing the service container between them.
 
 
-### ServiceContainer
+## `ServiceContainer` class
 
 
 Methods:
 Methods:
 
 
@@ -54,7 +52,7 @@ Methods:
 - `use(ctor, ...args)` adds a constructor and creates its instance
 - `use(ctor, ...args)` adds a constructor and creates its instance
 - `set(ctor, service)` adds a constructor and its instance
 - `set(ctor, service)` adds a constructor and its instance
 
 
-#### get
+### get
 
 
 The `get` method of the `ServiceContainer` class creates
 The `get` method of the `ServiceContainer` class creates
 an instance of the given constructor and saves it for next
 an instance of the given constructor and saves it for next
@@ -116,7 +114,7 @@ const hasService = childContainer.has(MyService);
 console.log(hasService); // true
 console.log(hasService); // true
 ```
 ```
 
 
-### Service
+## `Service` class
 
 
 Methods:
 Methods:
 
 
@@ -171,7 +169,7 @@ a service container and passing it between services,
 because this logic is encapsulated in the `Service`
 because this logic is encapsulated in the `Service`
 class and its `getService` method.
 class and its `getService` method.
 
 
-#### getService
+### getService
 
 
 The `getService` method ensures the existence of a single
 The `getService` method ensures the existence of a single
 instance of the requested service, rather than creating
 instance of the requested service, rather than creating