MCPcopy Index your code
hub / github.com/streamlit/streamlit / constructor

Method constructor

frontend/lib/src/render-tree/AppRoot.ts:185–205  ·  view source on GitHub ↗
(
    mainScriptHash: string,
    root: BlockNode,
    appLogo: AppLogo | null = null
  )

Source from the content-addressed store, hash-verified

183 }
184
185 public constructor(
186 mainScriptHash: string,
187 root: BlockNode,
188 appLogo: AppLogo | null = null
189 ) {
190 this.mainScriptHash = mainScriptHash
191 this.root = root
192 this.appLogo = appLogo
193
194 // Verify that our root node has exactly 4 children: a 'main' block,
195 // a 'sidebar' block, a `bottom` block and an 'event' block.
196 if (
197 this.root.children.length !== 4 ||
198 isNullOrUndefined(this.main) ||
199 isNullOrUndefined(this.sidebar) ||
200 isNullOrUndefined(this.event) ||
201 isNullOrUndefined(this.bottom)
202 ) {
203 throw new Error(`Invalid root node children! ${root.debug()}`)
204 }
205 }
206
207 public get main(): BlockNode {
208 const [main] = this.root.children

Callers

nothing calls this directly

Calls 2

isNullOrUndefinedFunction · 0.90
debugMethod · 0.65

Tested by

no test coverage detected