@electron-tools/ioc
Advanced tools
Comparing version 1.0.5 to 1.0.6
{ | ||
"name": "@electron-tools/ioc", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "DI implement of IOC", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js", |
@@ -7,3 +7,3 @@ # Introduction | ||
````bash | ||
```bash | ||
# install by npm | ||
@@ -31,3 +31,3 @@ $npm install @electron-tools/ioc | ||
} | ||
```` | ||
``` | ||
@@ -80,3 +80,3 @@ 3. use `inject` decorator inject your service to another service. | ||
// src/serviceA.ts | ||
import IOC, { service, inject } from '@electron-tools/ioc'; | ||
import IOC, { service, inject, INSTANTIATION_SERVICE_ID } from '@electron-tools/ioc'; | ||
@@ -86,3 +86,3 @@ @service('serviceA') // register ServiceA with unique id 'serviceA' using service decorator exported by ioc. | ||
constructor( | ||
@inject('instantiationService') readonly ioc: IOC, // ioc itself is also a service can be injected. | ||
@inject(INSTANTIATION_SERVICE_ID) readonly ioc: IOC, // ioc itself is also a service can be injected. | ||
) {} | ||
@@ -89,0 +89,0 @@ |
55696