Skip to content

v0.12.0

Compare
Choose a tag to compare
@Rokt33r Rokt33r released this 18 Jan 05:56
· 25 commits to master since this release
91a3098

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)