Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// auto bind via conventions
Object.keys(widgets).map(widgetName => {
const widgetTypeName = widgetName.toLowerCase()
const type = WIDGET_TYPES[widgetTypeName]
const clazz = widgets[widgetName]
if (type && isClassy(clazz)) {
widgetContainer.bind(type).to(clazz)
}
})
// merge container with runtime container here?
// see /docs on Service injection
// Container.merge(a: Container, b: Container)
const container = Container.merge(widgetContainer, runtimeContainer)
// might be easier to use
const containers = {
widget: widgetContainer,
runtime: runtimeContainer
}
// export both the app container (simply named container) from merge
// and the widget only container named widgetContainer
export {
lazyInject,
WIDGET_TYPES,
$TYPES,
containers,
container,
widgetContainer