Are there docs anywhere about avoiding `onXChanged...
# compose
c
Are there docs anywhere about avoiding
onXChanged
as an event name and instead having
onXChange
? I'm reading that back to myself in Florina's voice, but I can't seem to place my finger on where I saw that guidance.
đź’ˇ 3
a
if it's not already in the API guidelines it probably should be. This was a deliberate (and long discussed) decision to express present tense instead of past tense if the event represents a request that the event handler should act on, as opposed to a passive notification that something happened to a hidden source of truth that the developer doesn't own.
🙏🏼 1
🙏 2
r
Here's an example, from one of the first pages I read when learning Compose (https://developer.android.com/jetpack/compose/state): "The lambda is called onNameChange—present tense, as the event doesn't mean the state has already changed, but rather that the composable is requesting that the event handler change it."
🙏 2
🙏 2
🙏🏼 1
c
m
This makes sense to me for state changes, but not really for
onClick
, the click has already happened, the click indication ripple is animating, accessibility events were sent, so it looks to me like a “passive notification that something happened to a hidden source of truth that the developer doesn’t own”. But it’s still not called
onClicked
? How can I think about this?