1.0.0 • Published 6 years ago
provide-consume-decorator v1.0.0
provide-consume-decorator
Usage
@provide({
test: "test",
service() {
return "service";
},
})
class MyClass {
@consume("test") public test!: any;
@consume("service") public service!: any;
}
const my = new MyClass();
(my.test === "test");
(my.service == "service");Api
@provide({...dependecies})
Provide dependecies to a class
@provideVuex({...dependecies})
Provide dependecies for a vuex module
@consume("name") prop!
A property decorator. Supplies dependency to a class member.
Commands
npm run clean: clean the output folders./esand./js.npm run tslint: lint the ts filesnpm run tsc: compile the TypeScript in./tsinto ES2015 in the./esfolder.npm run babel: compile the ES2015 in the./esinto JavaScript in the./jsfolder.npm run compile: run both the tsc and the babel steps.npm run test: run unit tests.npm run watch: continuously run unit tests.
1.0.0
6 years ago