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

Method flush

packages/router-core/src/ssr/ssr-server.ts:113–121  ·  view source on GitHub ↗

* Flushes any pending scripts synchronously. * Call this before emitting onSerializationFinished to ensure all scripts are injected. * * IMPORTANT: Only injects if the barrier has been lifted. Before the barrier is lifted, * scripts should remain in the queue so takeBufferedScripts() can

()

Source from the content-addressed store, hash-verified

111 * scripts should remain in the queue so takeBufferedScripts() can retrieve them
112 */
113 flush() {
114 if (!this._scriptBarrierLifted) return
115 if (this._cleanedUp) return
116 this._pendingMicrotask = false
117 const scriptsToInject = this.takeAll()
118 if (scriptsToInject && this.router?.serverSsr) {
119 this.router.serverSsr.injectScript(scriptsToInject)
120 }
121 }
122
123 takeAll() {
124 const bufferedScripts = this._queue

Callers 3

createHistoryFunction · 0.80
NuFunction · 0.80

Calls 1

takeAllMethod · 0.95

Tested by

no test coverage detected