Repository URL to install this package:
|
Version:
1.2.20 ▾
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = asyncBootstrapper;
var _reactTreeWalker = _interopRequireDefault(require("../react-tree-walker"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
/* eslint-disable no-console */
const defaultContext = {
reactAsyncBootstrapperRunning: true // @todo empty_obj
};
function asyncBootstrapper(app, options, context = {}) {
const visitor = (element, instance) => {
if (instance && typeof instance.asyncBootstrap === 'function') {
return instance.asyncBootstrap();
}
return undefined;
};
return (0, _reactTreeWalker.default)(app, visitor, Object.assign({}, context, defaultContext), options);
}