Skip to content

Commit fb5de73

Browse files
committed
Replaced the singleton with a global variable for IE8 support.
1 parent c22f807 commit fb5de73

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

modules/BrowserHistory.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import DOMHistory from './DOMHistory';
22
import { getWindowPath, supportsHistory } from './DOMUtils';
33
import NavigationTypes from './NavigationTypes';
44

5-
var instance = null;
6-
75
function updateCurrentState(extraState) {
86
var state = window.history.state;
97

@@ -107,11 +105,7 @@ class BrowserHistory extends DOMHistory {
107105
window.location.replace(path);
108106
}
109107
}
110-
111-
static get history() {
112-
instance = instance || new BrowserHistory();
113-
return instance;
114-
}
115108
}
116109

110+
export var history = new BrowserHistory;
117111
export default BrowserHistory;

modules/HashHistory.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import NavigationTypes from './NavigationTypes';
44
import { getHashPath, replaceHashPath } from './DOMUtils';
55
import { isAbsolutePath } from './URLUtils';
66

7-
var instance = null;
87
var DefaultQueryKey = '_qk';
98

109
function ensureSlash() {
@@ -168,11 +167,7 @@ class HashHistory extends DOMHistory {
168167
makeHref(path) {
169168
return '#' + path;
170169
}
171-
172-
static get history() {
173-
instance = instance || new HashHistory();
174-
return instance;
175-
}
176170
}
177171

172+
export var history = new HashHistory;
178173
export default HashHistory;

0 commit comments

Comments
 (0)