class neuroglancer.trackable_state.TrackableState[State](
    
ChangeNotifier
)

State object that supports registering change notification callbacks.

Type Parameters:
State

Value type.

Public members

TrackableState(wrapper_type: type[State], ...)

Initialize self. See help(type(self)) for accurate signature.

set_state(new_state: Any | State, ...) -> str

Sets a new value.

state_and_generation: tuple[State, str]
raw_state_and_generation: tuple[Any, str]
state_generation: str
raw_state: Any
state: State
txn(
    
overwrite: bool = False, lock: bool = True) -> Iterator[State]

Context manager for a state modification transaction.

retry_txn(func: Callable[[State], State], retries: int = 10, ...)
__repr__() -> str

Return repr(self).

add_changed_callback(callback: Callable[[], None])

Registers a callback to be invoked when the state changes.

remove_changed_callback(callback: Callable[[], None])

Removes a previously-registered callback.

change_count: int

Total number of changes that have occurred.