react-crossroads
Version:
Client side router for web applications built with React and utilizing the Flux architecture. The backing routing engine is CrossroadsJs.
32 lines (26 loc) • 805 B
JavaScript
var RedirectChain,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
RedirectChain = (function() {
function RedirectChain(actions, toPath, currentChain) {
this.actions = actions;
this.toPath = toPath;
this.currentChain = currentChain;
this.render = __bind(this.render, this);
}
RedirectChain.prototype.render = function() {
setTimeout((function(_this) {
return function() {
return _this.actions.replace(_this.toPath);
};
})(this));
if (this.currentChain == null) {
return null;
}
if (this.currentChain instanceof RedirectChain) {
return this.currentChain.currentChain.render();
}
return this.currentChain.render();
};
return RedirectChain;
})();
module.exports = RedirectChain;