y-inversify
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

inversify封装

//org.ts
export class Org extends App {
	a = this.tree({
		providerA: this.bind(),
		providerB: this.bind(),
		controllerA: this.bind(),
	})
	constructor() {
		super("root");
		this.use(new Index())
		this.init()
	}
}
export const org = new Org()
import {inject, injectable, postConstruct} from "inversify";
@injectable()
export class cls {
    @inject(org.a.providerA.symbol) a;
    @postConstruct()
	protected init() {
		console.log("init")
		console.log(this)
	}
}
//test
import {inject,computed} from "vue"
org.a.providerA.toVueReactiveValue(computed(()=>inject('xxx')))
org.a.providerA.toVueReactiveClass(cls)
//in xxx
const req = org.a..providerA.get()
console.log(req)

Readme

Keywords

none

Package Sidebar

Install

npm i y-inversify

Weekly Downloads

2

Version

1.0.4

License

MIT

Unpacked Size

103 kB

Total Files

53

Last publish

Collaborators

  • ymstrip