in lib/classic/createBootstrapper.js [44:100]
function _Mixin(spec, callback) {
_classCallCheck(this, _Mixin);
// Check if a container spec was supplied
var _this = _possibleConstructorReturn(this, (_Mixin.__proto__ || Object.getPrototypeOf(_Mixin)).call(this));
if (!spec.container) {
console.warn('"Container" property was not supplied');
return _possibleConstructorReturn(_this);
}
// Set the component selector if defined
if (spec.componentSelector) {
_this.componentSelector = spec.componentSelector;
}
// Set the watcher value if defined
if (typeof spec.enableWatcher === 'boolean') {
_this.enableWatcher = spec.enableWatcher;
}
// Create a new container
var containerBuilder = new _ContainerBuilder2.default(spec.defaultOptions || null);
// Map the components
for (var i = 0; i < spec.container.length; i++) {
var registration = void 0;
if (spec.container[i].forAsync) {
registration = containerBuilder.registerAsync(spec.container[i].forAsync).as(spec.container[i].register);
} else {
registration = containerBuilder.register(spec.container[i].for).as(spec.container[i].register);
}
if (spec.container[i].withDefaultProps) {
registration.withDefaultProps(spec.container[i].withDefaultProps);
}
if (spec.container[i].withOptions) {
registration.withOptions(spec.container[i].withOptions);
}
}
_this._shouldUpdateProxy = spec.shouldUpdate || null;
_this._willUpdateProxy = spec.willUpdate || null;
_this._didUpdateProxy = spec.didUpdate || null;
_this._willUnmountProxy = spec.willUnmountHabitats || null;
_this._didUnmountProxy = spec.didUnmountHabitats || null;
_this._didDisposeProxy = spec.didDispose || null;
// Finally, set the container
_this.setContainer(containerBuilder.build(), function () {
if (typeof callback === 'function') {
callback();
}
});
return _this;
}