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

State object that supports registering change notification callbacks.

Type Parameters:
State

Value type.

Public members

TrackableState(wrapper_typetransform_state=None)

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

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

Sets a new value.

state_and_generationtuple[State, str]
raw_state_and_generationtuple[Any, str]
state_generationstr
raw_stateAny
stateState
txn(overwrite: bool = Falselock: bool = True)

Context manager for a state modification transaction.

retry_txn(funcretries: int = 10lock: bool = False)
__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_countint

Total number of changes that have occurred.