Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Callback Ordering Inconsistency in Documentation #759

Open
zacheryph opened this issue Mar 19, 2024 · 1 comment · May be fixed by #760
Open

Callback Ordering Inconsistency in Documentation #759

zacheryph opened this issue Mar 19, 2024 · 1 comment · May be fixed by #760

Comments

@zacheryph
Copy link

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’s connect() 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 before disconnect() lifecycle hooks.

@zacheryph
Copy link
Author

This is actually more wrong than correct. From my testing;

  • [name]TargetConnected() gets called before connect()
    this means Lifecycle Callbacks is correct
  • [name]TargetDisconnected() gets called after disconnect()
    this means both pages are wrong.

zacheryph added a commit to zacheryph/stimulus that referenced this issue Mar 19, 2024
@zacheryph zacheryph linked a pull request Mar 19, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant