onValueChanged

abstract fun onValueChanged(newValue: String?, updatedBy: Participant?)

Called every time the key is written, including writes made from this device — the store echoes your own setValue back, so drive state from here rather than from the call site and both sides stay in step.

The current value is not replayed on registering; you only see changes from then on.

Parameters

newValue

the value just written, or null when the key was cleared.

updatedBy

who wrote it, or null when the writer is not in the room any more or this device never saw them.