Skip to content

Commit

Permalink
update history
Browse files Browse the repository at this point in the history
  • Loading branch information
Cap32 committed Feb 13, 2018
1 parent 1a4ba3a commit 98d6982
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/createHistory.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default function createHistory(wrapper, history) {
const listen = history.listen.bind(history);
const listeners = [];
listen((location) => {
listen((location, action) => {
const { _location } = wrapper;
const prevLocation = {
pathname: _location._pathname,
Expand All @@ -12,7 +12,7 @@ export default function createHistory(wrapper, history) {
_location._search = location.search;
_location._hash = location.hash;
for (const listener of listeners) {
listener(_location, prevLocation);
listener(_location, prevLocation, action);
}
});
history.listen = function listen(listener) {
Expand Down

0 comments on commit 98d6982

Please sign in to comment.