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
  b5113cab_d984_a93c_89b1_a197387b5da3["_flush()"]
  f05845f9_ab92_f302_7c35_d458f3105a3d["TemplateStream"]
  b5113cab_d984_a93c_89b1_a197387b5da3 -->|defined in| f05845f9_ab92_f302_7c35_d458f3105a3d
  a7382fc7_2a1c_21c4_593d_a281d216bdcd["renderState()"]
  b5113cab_d984_a93c_89b1_a197387b5da3 -->|calls| a7382fc7_2a1c_21c4_593d_a281d216bdcd
  774bdfd4_b797_21a8_42aa_0b7360c53c24["renderScripts()"]
  b5113cab_d984_a93c_89b1_a197387b5da3 -->|calls| 774bdfd4_b797_21a8_42aa_0b7360c53c24
  style b5113cab_d984_a93c_89b1_a197387b5da3 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