@tanstack/react-router 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -93,13 +93,15 @@
|
|
|
93
93
|
push: (path, state) => {
|
|
94
94
|
state = assignKey(state);
|
|
95
95
|
tryNavigation(() => {
|
|
96
|
-
opts.pushState(path, state
|
|
96
|
+
opts.pushState(path, state);
|
|
97
|
+
onUpdate();
|
|
97
98
|
});
|
|
98
99
|
},
|
|
99
100
|
replace: (path, state) => {
|
|
100
101
|
state = assignKey(state);
|
|
101
102
|
tryNavigation(() => {
|
|
102
|
-
opts.replaceState(path, state
|
|
103
|
+
opts.replaceState(path, state);
|
|
104
|
+
onUpdate();
|
|
103
105
|
});
|
|
104
106
|
},
|
|
105
107
|
go: index => {
|
|
@@ -204,7 +206,7 @@
|
|
|
204
206
|
};
|
|
205
207
|
|
|
206
208
|
// This function queues up a call to update the browser history
|
|
207
|
-
const queueHistoryAction = (type, destHref, state
|
|
209
|
+
const queueHistoryAction = (type, destHref, state) => {
|
|
208
210
|
const href = createHref(destHref);
|
|
209
211
|
if (!scheduled) {
|
|
210
212
|
rollbackLocation = currentLocation;
|
|
@@ -219,9 +221,6 @@
|
|
|
219
221
|
state,
|
|
220
222
|
isPush: next?.isPush || type === 'push'
|
|
221
223
|
};
|
|
222
|
-
|
|
223
|
-
// Notify subscribers
|
|
224
|
-
onUpdate();
|
|
225
224
|
if (!scheduled) {
|
|
226
225
|
// Schedule an update to the browser history
|
|
227
226
|
scheduled = Promise.resolve().then(() => flush());
|
|
@@ -235,8 +234,8 @@
|
|
|
235
234
|
var originalReplaceState = win.history.replaceState;
|
|
236
235
|
const history = createHistory({
|
|
237
236
|
getLocation,
|
|
238
|
-
pushState: (href, state
|
|
239
|
-
replaceState: (href, state
|
|
237
|
+
pushState: (href, state) => queueHistoryAction('push', href, state),
|
|
238
|
+
replaceState: (href, state) => queueHistoryAction('replace', href, state),
|
|
240
239
|
back: () => win.history.back(),
|
|
241
240
|
forward: () => win.history.forward(),
|
|
242
241
|
go: n => win.history.go(n),
|