pysepal.solara.ui_state.get_scoped_state#

pysepal.solara.ui_state.get_scoped_state(name, factory, scope_id=None)[source]#

Return the name state for a scope, creating it on miss.

Parameters:
  • name (str) – Key of the state within the scope, e.g. "theme_state".

  • factory (Callable[[], T]) – Zero-argument callable building the state on first access.

  • scope_id (str | None) – Scope to read from; defaults to the current one.

Returns:

The stored state instance.

Return type:

T