@wildebeest/component
Advanced tools
Comparing version 0.1.2 to 0.1.3
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ComponentBindService_1 = require("./ComponentBindService"); | ||
var common_1 = require("@wildebeest/common"); | ||
var ComponentModule = (function () { | ||
@@ -7,3 +9,3 @@ function ComponentModule() { | ||
ComponentModule.prototype.getDependencies = function () { | ||
return []; | ||
return [common_1.CommonModule]; | ||
}; | ||
@@ -16,2 +18,8 @@ ComponentModule.prototype.register = function (container) { | ||
}); | ||
container.bind('Factory<ComponentBinder>').toFactory(function (context) { | ||
return function (name) { | ||
return context.container.getNamed('ComponentBinder', name); | ||
}; | ||
}); | ||
container.bind(ComponentBindService_1.ComponentBindService).toSelf().inSingletonScope(); | ||
}; | ||
@@ -18,0 +26,0 @@ ComponentModule.prototype.boot = function (container) { }; |
export { ComponentModule } from './ComponentModule'; | ||
export { Component } from './Component'; | ||
export { ComponentBuilder } from './ComponentBuilder'; | ||
export { ComponentBinder } from './ComponentBinder'; | ||
export { ComponentBindService } from './ComponentBindService'; |
@@ -5,2 +5,4 @@ "use strict"; | ||
exports.ComponentModule = ComponentModule_1.ComponentModule; | ||
var ComponentBindService_1 = require("./ComponentBindService"); | ||
exports.ComponentBindService = ComponentBindService_1.ComponentBindService; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@wildebeest/component", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Components", | ||
@@ -10,3 +10,6 @@ "main": "dist/index.js", | ||
"test": "jest", | ||
"deploy": "npm run test && npm run build && git add -A && git commit -m 'deploy' && git push origin master" | ||
"deploy": "npm run test && npm run build && git add -A && git commit -m 'deploy' && git push origin master", | ||
"patch": "npm run deploy && npm version patch && npm publish", | ||
"minor": "npm run deploy && npm version minor && npm publish", | ||
"major": "npm run deploy && npm version major && npm publish" | ||
}, | ||
@@ -13,0 +16,0 @@ "repository": { |
import { Module } from "@wildebeest/js-modules"; | ||
import { Container, interfaces } from "inversify"; | ||
import { ComponentBuilder } from "./ComponentBuilder"; | ||
import { ComponentBinder } from "./ComponentBinder"; | ||
import { ComponentBindService } from "./ComponentBindService"; | ||
import { CommonModule } from "@wildebeest/common"; | ||
@@ -9,3 +12,3 @@ export class ComponentModule implements Module | ||
{ | ||
return []; | ||
return [CommonModule]; | ||
} | ||
@@ -20,2 +23,8 @@ | ||
}); | ||
container.bind<interfaces.Factory<ComponentBinder>>('Factory<ComponentBinder>').toFactory<ComponentBinder>((context: interfaces.Context) => { | ||
return (name: string) => { | ||
return context.container.getNamed('ComponentBinder', name); | ||
} | ||
}); | ||
container.bind<ComponentBindService>(ComponentBindService).toSelf().inSingletonScope(); | ||
} | ||
@@ -22,0 +31,0 @@ |
export { ComponentModule } from './ComponentModule'; | ||
export { Component } from './Component'; | ||
export { ComponentBuilder } from './ComponentBuilder'; | ||
export { ComponentBuilder } from './ComponentBuilder'; | ||
export { ComponentBinder } from './ComponentBinder'; | ||
export { ComponentBindService } from './ComponentBindService'; |
import 'ts-jest'; | ||
import { Application } from '@wildebeest/js-modules'; | ||
import { ComponentModule } from '../src/ComponentModule'; | ||
import { ComponentBindService } from '../src/ComponentBindService'; | ||
@@ -10,2 +11,4 @@ let app: Application = new Application(); | ||
expect(app.getContainer().get('Factory<ComponentBuilder>')).toBeDefined(); | ||
expect(app.getContainer().get('Factory<ComponentBinder>')).toBeDefined(); | ||
expect(app.getContainer().get(ComponentBindService)).toBeInstanceOf(ComponentBindService); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15836
31
274