Home / Function/ _flush() — vue Function Reference

_flush() — vue Function Reference

Architecture documentation for the _flush() function in template-stream.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  b826801b_639e_be55_d795_731fd2aa3dc5["_flush()"]
  28d68c7e_2c7f_5bb2_b735_7354abc74108["TemplateStream"]
  b826801b_639e_be55_d795_731fd2aa3dc5 -->|defined in| 28d68c7e_2c7f_5bb2_b735_7354abc74108
  1788e29c_e4bb_9fb7_3ffa_5decd1d21123["renderState()"]
  b826801b_639e_be55_d795_731fd2aa3dc5 -->|calls| 1788e29c_e4bb_9fb7_3ffa_5decd1d21123
  0887ee34_8d99_7e8a_1cbb_dc5cefba6b9d["renderScripts()"]
  b826801b_639e_be55_d795_731fd2aa3dc5 -->|calls| 0887ee34_8d99_7e8a_1cbb_dc5cefba6b9d
  style b826801b_639e_be55_d795_731fd2aa3dc5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/server-renderer/src/template-renderer/template-stream.ts lines 61–80

  _flush(done: Function) {
    this.emit('beforeEnd')

    if (this.inject) {
      // inline initial store state
      const state = this.renderer.renderState(this.context)
      if (state) {
        this.push(state)
      }

      // embed scripts needed
      const scripts = this.renderer.renderScripts(this.context)
      if (scripts) {
        this.push(scripts)
      }
    }

    this.push(this.template.tail(this.context))
    done()
  }

Subdomains

Frequently Asked Questions

What does _flush() do?
_flush() is a function in the vue codebase, defined in packages/server-renderer/src/template-renderer/template-stream.ts.
Where is _flush() defined?
_flush() is defined in packages/server-renderer/src/template-renderer/template-stream.ts at line 61.
What does _flush() call?
_flush() calls 2 function(s): renderScripts, renderState.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free