react-isomorphic-tools
Advanced tools
Comparing version 3.0.0-alpha.11 to 3.0.0-alpha.12
@@ -9,2 +9,6 @@ 'use strict'; | ||
var _ReduxResolver = require('../../Resolver/ReduxResolver'); | ||
var _ReduxResolver2 = _interopRequireDefault(_ReduxResolver); | ||
var _constants = require('../constants'); | ||
@@ -14,2 +18,4 @@ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var lock = true; | ||
@@ -19,3 +25,3 @@ | ||
exports.default = function (history, resolver) { | ||
exports.default = function (history) { | ||
return function (store) { | ||
@@ -36,11 +42,4 @@ return function (next) { | ||
if (action.payload.code === 303) { | ||
var _action$payload = action.payload, | ||
to = _action$payload.to, | ||
e = _action$payload.e, | ||
location = _action$payload.location; | ||
next(action); | ||
store.dispatch((0, _reactRouterRedux.push)(to === '/error' ? { | ||
pathname: to, search: '?errorData=' + JSON.stringify({ location: location, e: e }) | ||
} : to)); | ||
store.dispatch((0, _reactRouterRedux.push)('/')); | ||
} | ||
@@ -54,5 +53,5 @@ | ||
} else { | ||
resolver.resolve(history.location).then(function () { | ||
next(action); | ||
}).catch(function (e) { | ||
var resolver = new _ReduxResolver2.default(); | ||
next(action); | ||
resolver.resolve(history.location).then(function () {}).catch(function (e) { | ||
store.dispatch((0, _preload.fail)(e, history.location)); | ||
@@ -59,0 +58,0 @@ }); |
@@ -34,10 +34,2 @@ 'use strict'; | ||
_this.handleLocationChange = function () { | ||
var _this$props = _this.props, | ||
resolver = _this$props.resolver, | ||
history = _this$props.history; | ||
resolver.resolve(history.location); | ||
}; | ||
_this.resolver = props.resolver; | ||
@@ -53,14 +45,2 @@ return _this; | ||
}, { | ||
key: 'componentDidMount', | ||
value: function componentDidMount() { | ||
var history = this.props.history; | ||
this.unsubscribeFromHistory = history.listen(this.handleLocationChange); | ||
} | ||
}, { | ||
key: 'componentWillUnmount', | ||
value: function componentWillUnmount() { | ||
if (this.unsubscribeFromHistory) this.unsubscribeFromHistory(); | ||
} | ||
}, { | ||
key: 'render', | ||
@@ -77,3 +57,2 @@ value: function render() { | ||
resolver: _propTypes2.default.object.isRequired, | ||
history: _propTypes2.default.object.isRequired, | ||
children: _propTypes2.default.element.isRequired | ||
@@ -80,0 +59,0 @@ }; |
{ | ||
"name": "react-isomorphic-tools", | ||
"version": "3.0.0-alpha.11", | ||
"version": "3.0.0-alpha.12", | ||
"description": "Authorization, Fetcher, Preload. Tools for ServerSide rendering", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
140559
1371