ts-ioc-container 50.2.5 → 50.2.6
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.
- package/README.md +3 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ provider pipelines, aliases, and custom injector strategies.
|
|
|
47
47
|
- [Alias](#alias) `asAlias`
|
|
48
48
|
- [Decorator](#decorator) `decorate`
|
|
49
49
|
- [Registration](#registration) `@register`
|
|
50
|
-
- [
|
|
50
|
+
- [Token](#token) `bindTo`
|
|
51
51
|
- [Scope](#scope) `scope`
|
|
52
52
|
- [Module](#module)
|
|
53
53
|
- [Hook](#hook) `@hook`
|
|
@@ -2146,12 +2146,9 @@ Registration is provider factory which registers provider in container.
|
|
|
2146
2146
|
- `Registration.fromValue(Logger)`
|
|
2147
2147
|
- `Registration.fromFn((container, options) => container.resolve(Logger, options))`
|
|
2148
2148
|
|
|
2149
|
-
###
|
|
2149
|
+
### Token
|
|
2150
2150
|
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
- by default, key is class name
|
|
2154
|
-
- you can assign the same key to different registrations
|
|
2151
|
+
Use `bindTo(key)` to register a provider under a specific key. By default the key is the class name. Multiple registrations can share the same key.
|
|
2155
2152
|
|
|
2156
2153
|
> [!TIP]
|
|
2157
2154
|
> Prefer `SingleToken<T>` over plain string literals as registration keys. Tokens are type-safe, rename-friendly, and prevent typos that only surface at runtime.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-ioc-container",
|
|
3
|
-
"version": "50.2.
|
|
3
|
+
"version": "50.2.6",
|
|
4
4
|
"description": "Fast, lightweight TypeScript dependency injection container with a clean API, scoped lifecycles, decorators, tokens, hooks, lazy injection, customizable providers, and no global container objects.",
|
|
5
5
|
"workspaces": [
|
|
6
6
|
"docs"
|