Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
viewConfigUpdated(newConfig: ReactViewConfig) {
if (newConfig === this.uiViewData.config) {
return;
}
let trans: Transition;
let resolves = {};
if (newConfig) {
let viewContext: ViewContext = newConfig.viewDecl && newConfig.viewDecl.$context;
this.uiViewAddress = {
fqn: this.uiViewAddress.fqn,
context: viewContext,
};
let resolveContext = new ResolveContext(newConfig.path);
let injector = resolveContext.injector();
let stringTokens: string[] = resolveContext.getTokens().filter(x => typeof x === 'string');
if (stringTokens.indexOf('transition') !== -1) {
throw TransitionPropCollisionError;
}
trans = injector.get(Transition);
resolves = stringTokens.map(token => [token, injector.get(token)]).reduce(applyPairs, {});
}
this.uiViewData.config = newConfig;
const key = Date.now();
let props = { ...resolves, transition: trans, key };
let newComponent = newConfig && newConfig.viewDecl && newConfig.viewDecl.component;