v0.12.0
Features
- Expose internal injector api,
Injector
.
Now you can use DI without tachijs. It is useful for some testing and scripts which don't need to use tachijs server.
import { Injector } from 'tachijs'
// Create injector
const injector = new Injector(container)
// Instantiate by a key
const myService = injector.inject<MyService>(ServiceTypes.MyService)
// Instantiate by a constructor
const myService = injector.instantiate(MyService)