inject-decorators:简单的依赖注入器

时间:2021-04-30 09:40:30
【文件属性】:
文件名称:inject-decorators:简单的依赖注入器
文件大小:5KB
文件格式:ZIP
更新时间:2021-04-30 09:40:30
JavaScript 注入装饰器 简单的依赖注入器。 开始吧 npm install --save-dev inject-decorators 用法 let num = 1; let str = "abc"; let bool = true; let symbol = Symbol(); @Inject(num, str, bool, symbol) class Foo { constructor(num, str, bool, symbol) { this.num = num; this.str = str; this.bool = bool; this.symbol = symbol; } }; let foo = new Foo(); assert(foo.num === num); assert(foo.str === str); assert(foo.bool
【文件预览】:
inject-decorators-master
----.travis.yml(961B)
----.babelrc(12B)
----package.json(992B)
----test()
--------index.spec.js(6KB)
----src()
--------index.js(2KB)
----.gitignore(18B)
----README.md(803B)

网友评论