Callback Ordering Inconsistency in Documentation
zacheryph opened this issue · comments
The ordering of callbacks is inconsistent in the documentation. It'd be nice if they were consistent. One place notes [name]TargetConnected
callbacks get called before connect
, and the other says it gets called after.
"Lifecycle" wise and setup, it'd make sense that the target callbacks happen after connect()
and before disconnect()
. Note, the disconnect callbacks are consistent on both pages.
Reference > Lifecycle Callbacks
This page states the following
The
[name]TargetConnected()
lifecycle callbacks will fire before the controller’sconnect()
callback.
Reference > Targets
This page states the opposite
Stimulus invokes each element callback any time its target elements are added or removed after
connect()
and beforedisconnect()
lifecycle hooks.
This is actually more wrong than correct. From my testing;
[name]TargetConnected()
gets called beforeconnect()
this means Lifecycle Callbacks is correct[name]TargetDisconnected()
gets called afterdisconnect()
this means both pages are wrong.