Home / Function/ _read() — vue Function Reference

_read() — vue Function Reference

Architecture documentation for the _read() function in render-stream.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  4e0244b9_505f_366e_4bd9_e5e84c94da8e["_read()"]
  5f3e77fd_2395_2037_8fe2_ddb0a0a503a8["RenderStream"]
  4e0244b9_505f_366e_4bd9_e5e84c94da8e -->|defined in| 5f3e77fd_2395_2037_8fe2_ddb0a0a503a8
  ef9263a5_4bc9_37dd_6172_60f913bb3926["pushBySize()"]
  4e0244b9_505f_366e_4bd9_e5e84c94da8e -->|calls| ef9263a5_4bc9_37dd_6172_60f913bb3926
  f87747f3_6ceb_eb36_5e57_d014eb436990["tryRender()"]
  4e0244b9_505f_366e_4bd9_e5e84c94da8e -->|calls| f87747f3_6ceb_eb36_5e57_d014eb436990
  b5bbea85_4b9b_c154_6a8e_15e96d994434["tryNext()"]
  4e0244b9_505f_366e_4bd9_e5e84c94da8e -->|calls| b5bbea85_4b9b_c154_6a8e_15e96d994434
  style 4e0244b9_505f_366e_4bd9_e5e84c94da8e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/server-renderer/src/render-stream.ts lines 79–99

  _read(n: number) {
    this.expectedSize = n
    // it's possible that the last chunk added bumped the buffer up to > 2 * n,
    // which means we will need to go through multiple read calls to drain it
    // down to < n.
    if (isTrue(this.done)) {
      this.push(null)
      return
    }
    if (this.buffer.length >= n) {
      this.pushBySize(n)
      return
    }
    if (isUndef(this.next)) {
      // start the rendering chain.
      this.tryRender()
    } else {
      // continue with the rendering.
      this.tryNext()
    }
  }

Subdomains

Frequently Asked Questions

What does _read() do?
_read() is a function in the vue codebase, defined in packages/server-renderer/src/render-stream.ts.
Where is _read() defined?
_read() is defined in packages/server-renderer/src/render-stream.ts at line 79.
What does _read() call?
_read() calls 3 function(s): pushBySize, tryNext, tryRender.

Analyze Your Own Codebase

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

Try Supermodel Free