ts-ioc-container 23.3.2 → 23.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +5 -4
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -27,7 +27,7 @@ yarn add ts-ioc-container reflect-metadata
27
27
 
28
28
  ## Setup
29
29
  ### reflect-metadata
30
- Just put it in the main file of your project. It should be first line of the code.
30
+ Just put it in the main file of your project. It should be the first line of the code.
31
31
  ```typescript
32
32
  import 'reflect-metadata';
33
33
  ```
@@ -72,7 +72,8 @@ container.dispose();
72
72
  ### Scopes
73
73
  Sometimes you need to create a scope of container. For example, when you want to create a scope per request in web application.
74
74
 
75
- - NOTICE: when you create a scope of container then all providers are cloned to new scope. For that reason every provider has methods `clone` and `isValid` to clone itself and check if it's valid for certain scope. And every scope has method `hasTag` to check if it's valid for certain provider.
75
+ - NOTICE: remember that when you scope doesn't have dependency then it will be resolved from parent container
76
+ - NOTICE: when you create a scope of container then all providers are cloned to new scope. For that reason every provider has methods `clone` and `isValid` to clone itself and check if it's valid for certain scope accordingly.
76
77
 
77
78
  ```typescript
78
79
  import { Container, ReflectionInjector } from "ts-ioc-container";
@@ -82,9 +83,9 @@ const scope = container.createScope();
82
83
  ```
83
84
 
84
85
  ### Tags
85
- Sometimes you want to mark some providers and resolve them only from certain scope.
86
+ Sometimes you want to mark some providers and resolve them only from certain scope. So you can assign tags to providers and create scopes with certain tags. For that reason every scope has method `hasTag` which we invoke from provider to check if it's valid for certain scope.
86
87
 
87
- - tag - is a string that can be used to mark each container and scope
88
+ - tag - is a string that we assign to provider and scope/container
88
89
  - every provider can be registered per certain tags and cannot be resolved from container with other tags. Only from parent one with certain tags.
89
90
  - NOTICE: when you create a scope then we clone ONLY tags-matched providers.
90
91
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-ioc-container",
3
- "version": "23.3.2",
3
+ "version": "23.3.3",
4
4
  "description": "Typescript IoC container",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -52,5 +52,5 @@
52
52
  "ts-jest": "27.0.5",
53
53
  "typescript": "4.4.3"
54
54
  },
55
- "gitHead": "8734c4ffb51b8544f037ec2aedb76567579e9e39"
55
+ "gitHead": "1e371026880aaf0022c15baadb7d8c3411f7a217"
56
56
  }