Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let createRestoreFactory = (data) => {
return ({id, Module}, dependencies) => {
if (data[id]) {
return Module.restore(data[id], dependencies);
}
}
};
diConfig.factories = [
createRestoreFactory(diData),
createMethodFactory(),
createInstanceFactory()
];
diConfig.resolvers.push(staticResolver({FetchRequest}));
diConfig.dependencies.request = 'FetchRequest';
let di = createContainer(diConfig);
di.put('renderer', new DomRenderer());
then(di({'env': 'env', router: 'router'}, {di}), ({env, router}) => {
return router.start().then(event => {
env.render(event.page, document.body.firstChild);
});
});