MCPcopy
hub / github.com/streamlit/streamlit / createState

Method createState

frontend/lib/src/WidgetStateManager.ts:153–157  ·  view source on GitHub ↗

* Create a new WidgetState proto for the widget with the given ID, * overwriting any that currently exists.

(widgetId: string)

Source from the content-addressed store, hash-verified

151 * overwriting any that currently exists.
152 */
153 public createState(widgetId: string): WidgetState {
154 const state = new WidgetState({ id: widgetId })
155 this.widgetStates.set(widgetId, state)
156 return state
157 }
158
159 /** Return the WidgetState for the given widgetID if it exists. */
160 public getState(widgetId: string): WidgetState | undefined {

Callers 2

createWidgetStateMethod · 0.80

Calls 1

setMethod · 0.45

Tested by

no test coverage detected