Comparing version 2.6.0-beta.14 to 2.6.0-beta.15
@@ -163,3 +163,3 @@ import _objectSpread from '@babel/runtime/helpers/esm/objectSpread'; | ||
setupApp: function setupApp(app) { | ||
app._history = patchHistory(history); // app._history = patchHistory(history); | ||
app._history = patchHistory(history); | ||
} | ||
@@ -241,4 +241,21 @@ }; | ||
history.listen = function (callback) { | ||
// Let ConnectedRouter to sync history to store first | ||
// connected-react-router's version is locked since the check function may be broken | ||
// ref: https://github.com/umijs/umi/issues/2693 | ||
var isConnectedRouterHandler = callback.name === 'handleLocationChange' && callback.toString().indexOf('onLocationChanged') > -1; | ||
callback(history.location, history.action); | ||
return oldListen.call(history, callback); | ||
return oldListen.call(history, function () { | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
if (isConnectedRouterHandler) { | ||
callback.apply(void 0, args); | ||
} else { | ||
// Delay all listeners besides ConnectedRouter | ||
setTimeout(function () { | ||
callback.apply(void 0, args); | ||
}); | ||
} | ||
}); | ||
}; | ||
@@ -245,0 +262,0 @@ |
@@ -293,3 +293,3 @@ 'use strict'; | ||
setupApp: function setupApp(app) { | ||
app._history = patchHistory(history$1); // app._history = patchHistory(history); | ||
app._history = patchHistory(history$1); | ||
} | ||
@@ -371,4 +371,21 @@ }; | ||
history.listen = function (callback) { | ||
// Let ConnectedRouter to sync history to store first | ||
// connected-react-router's version is locked since the check function may be broken | ||
// ref: https://github.com/umijs/umi/issues/2693 | ||
var isConnectedRouterHandler = callback.name === 'handleLocationChange' && callback.toString().indexOf('onLocationChanged') > -1; | ||
callback(history.location, history.action); | ||
return oldListen.call(history, callback); | ||
return oldListen.call(history, function () { | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
if (isConnectedRouterHandler) { | ||
callback.apply(void 0, args); | ||
} else { | ||
// Delay all listeners besides ConnectedRouter | ||
setTimeout(function () { | ||
callback.apply(void 0, args); | ||
}); | ||
} | ||
}); | ||
}; | ||
@@ -375,0 +392,0 @@ |
{ | ||
"name": "dva", | ||
"version": "2.6.0-beta.14", | ||
"version": "2.6.0-beta.15", | ||
"description": "React and redux based, lightweight and elm-style framework.", | ||
@@ -37,3 +37,3 @@ "main": "dist/index.js", | ||
"@types/react-router-dom": "^4.3.1", | ||
"connected-react-router": "^6.3.2", | ||
"connected-react-router": "6.3.2", | ||
"dva-core": "2.0.0", | ||
@@ -40,0 +40,0 @@ "global": "^4.3.2", |
@@ -33,3 +33,2 @@ import React from 'react'; | ||
app._history = patchHistory(history); | ||
// app._history = patchHistory(history); | ||
}, | ||
@@ -110,4 +109,19 @@ }; | ||
history.listen = callback => { | ||
// Let ConnectedRouter to sync history to store first | ||
// connected-react-router's version is locked since the check function may be broken | ||
// ref: https://github.com/umijs/umi/issues/2693 | ||
const isConnectedRouterHandler = | ||
callback.name === 'handleLocationChange' && | ||
callback.toString().indexOf('onLocationChanged') > -1; | ||
callback(history.location, history.action); | ||
return oldListen.call(history, callback); | ||
return oldListen.call(history, (...args) => { | ||
if (isConnectedRouterHandler) { | ||
callback(...args); | ||
} else { | ||
// Delay all listeners besides ConnectedRouter | ||
setTimeout(() => { | ||
callback(...args); | ||
}); | ||
} | ||
}); | ||
}; | ||
@@ -114,0 +128,0 @@ return history; |
45415
1292
+ Addedconnected-react-router@6.3.2(transitive)
+ Addedimmutable@3.8.2(transitive)
+ Addedreact-redux@6.0.1(transitive)
- Removedconnected-react-router@6.9.3(transitive)
- Removedimmutable@4.3.6(transitive)
- Removedlodash.isequalwith@4.4.0(transitive)
- Removedreact-router@5.3.4(transitive)
Updatedconnected-react-router@6.3.2