The state of the app.
| 158 | |
| 159 | |
| 160 | class BaseState(Base, ABC, extra=pydantic.Extra.allow): |
| 161 | """The state of the app.""" |
| 162 | |
| 163 | # A map from the var name to the var. |
| 164 | vars: ClassVar[Dict[str, Var]] = {} |
| 165 | |
| 166 | # The base vars of the class. |
| 167 | base_vars: ClassVar[Dict[str, BaseVar]] = {} |
| 168 | |
| 169 | # The computed vars of the class. |
| 170 | computed_vars: ClassVar[Dict[str, ComputedVar]] = {} |
| 171 | |
| 172 | # Vars inherited by the parent state. |
| 173 | inherited_vars: ClassVar[Dict[str, Var]] = {} |
| 174 | |
| 175 | # Backend vars that are never sent to the client. |
| 176 | backend_vars: ClassVar[Dict[str, Any]] = {} |
| 177 | |
| 178 | # Backend vars inherited |
| 179 | inherited_backend_vars: ClassVar[Dict[str, Any]] = {} |
| 180 | |
| 181 | # The event handlers. |
| 182 | event_handlers: ClassVar[Dict[str, EventHandler]] = {} |
| 183 | |
| 184 | # A set of subclassses of this class. |
| 185 | class_subclasses: ClassVar[Set[Type[BaseState]]] = set() |
| 186 | |
| 187 | # Mapping of var name to set of computed variables that depend on it |
| 188 | _computed_var_dependencies: ClassVar[Dict[str, Set[str]]] = {} |
| 189 | |
| 190 | # Mapping of var name to set of substates that depend on it |
| 191 | _substate_var_dependencies: ClassVar[Dict[str, Set[str]]] = {} |
| 192 | |
| 193 | # Set of vars which always need to be recomputed |
| 194 | _always_dirty_computed_vars: ClassVar[Set[str]] = set() |
| 195 | |
| 196 | # Set of substates which always need to be recomputed |
| 197 | _always_dirty_substates: ClassVar[Set[str]] = set() |
| 198 | |
| 199 | # The parent state. |
| 200 | parent_state: Optional[BaseState] = None |
| 201 | |
| 202 | # The substates of the state. |
| 203 | substates: Dict[str, BaseState] = {} |
| 204 | |
| 205 | # The set of dirty vars. |
| 206 | dirty_vars: Set[str] = set() |
| 207 | |
| 208 | # The set of dirty substates. |
| 209 | dirty_substates: Set[str] = set() |
| 210 | |
| 211 | # The routing path that triggered the state |
| 212 | router_data: Dict[str, Any] = {} |
| 213 | |
| 214 | # Per-instance copy of backend variable values |
| 215 | _backend_vars: Dict[str, Any] = {} |
| 216 | |
| 217 | # The router data for the current page |
nothing calls this directly
no test coverage detected