MCPcopy
hub / github.com/TanStack/router / flush

Function flush

packages/history/src/index.ts:346–368  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

344
345 // This function flushes the next update to the browser history
346 const flush = () => {
347 if (!next) {
348 return
349 }
350
351 // We need to ignore any updates to the subscribers while we update the browser history
352 history._ignoreSubscribers = true
353
354 // Update the browser history
355 ;(next.isPush ? win.history.pushState : win.history.replaceState)(
356 next.state,
357 '',
358 next.href,
359 )
360
361 // Stop ignoring subscriber updates
362 history._ignoreSubscribers = false
363
364 // Reset the nextIsPush flag and clear the scheduled update
365 next = undefined
366 scheduled = undefined
367 rollbackLocation = undefined
368 }
369
370 // This function queues up a call to update the browser history
371 const queueHistoryAction = (

Callers 1

queueHistoryActionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected