Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onTransitionError(transition: Transition) {
// Clear state loading bar. Ignore parent states (type is SUPERSEDED) as child states will load next.
if (transition.error().type !== RejectType.SUPERSEDED) {
clearTimeout(this.stateLoaderTimeout);
this.stateLoaderTimeout = null;
this.loadingService.resolveAll(STATE_LOADER);
}
}
}
onTransitionError(transition: Transition) {
// Clear state loading bar. Ignore parent states (type is SUPERSEDED) as child states will load next.
if (transition.error().type !== RejectType.SUPERSEDED) {
clearTimeout(this.stateLoaderTimeout);
this.stateLoaderTimeout = null;
this.loadingService.resolveAll(STATE_LOADER);
}
}
}
return function(err: Rejection) {
let dispatcher;
if (err.type === RejectType.SUPERSEDED && err.redirected === true) {
dispatcher = dispatch(REDIRECTED_TRANSITION, store, trans);
} else if ((err.type = RejectType.IGNORED)) {
dispatcher = dispatch(IGNORED_TRANSITION, store, trans);
} else {
dispatcher = noop;
}
dispatcher();
};
}