Skip to content

Commit b42bd9a

Browse files
committed
Move method definitions
1 parent 8562482 commit b42bd9a

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

modules/stores/URLStore.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,38 @@ var _location;
1111
var _currentPath = '/';
1212
var _lastPath = null;
1313

14+
function getWindowPath() {
15+
return window.location.pathname + window.location.search;
16+
}
17+
1418
var EventEmitter = require('event-emitter');
1519
var _events = EventEmitter();
1620

1721
function notifyChange() {
1822
_events.emit('change');
1923
}
2024

21-
function getWindowPath() {
22-
return window.location.pathname + window.location.search;
23-
}
24-
2525
/**
2626
* The URLStore keeps track of the current URL. In DOM environments, it may be
2727
* attached to window.location to automatically sync with the URL in a browser's
2828
* location bar. <Route>s subscribe to the URLStore to know when the URL changes.
2929
*/
3030
var URLStore = {
3131

32+
/**
33+
* Adds a listener that will be called when this store changes.
34+
*/
35+
addChangeListener: function (listener) {
36+
_events.on('change', listener);
37+
},
38+
39+
/**
40+
* Removes the given change listener.
41+
*/
42+
removeChangeListener: function (listener) {
43+
_events.off('change', listener);
44+
},
45+
3246
/**
3347
* Returns the type of navigation that is currently being used.
3448
*/
@@ -164,20 +178,6 @@ var URLStore = {
164178
}
165179

166180
_location = null;
167-
},
168-
169-
/**
170-
* Adds a listener that will be called when this store changes.
171-
*/
172-
addChangeListener: function (listener) {
173-
_events.on('change', listener);
174-
},
175-
176-
/**
177-
* Removes the given change listener.
178-
*/
179-
removeChangeListener: function (listener) {
180-
_events.off('change', listener);
181181
}
182182

183183
};

0 commit comments

Comments
 (0)