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

Add simple core events #299

Closed
wants to merge 2 commits into from
Closed

Add simple core events #299

wants to merge 2 commits into from

Conversation

ryangjchandler
Copy link
Contributor

@ryangjchandler ryangjchandler commented Mar 23, 2020

This PR closes #283 and introduces three new events that are dispatched throughout the Alpine lifecycle.

  1. alpine:loaded - fired at the document level once Alpine has discovered and initialised all components.

  2. alpine:transition-start - fired at the transitioning element level once a transition has started but will bubble up to higher levels.

  3. alpine:transition-end - fired at the transitioning element level after a transition has ended but will bubble up to higher levels.

Happy to make changes to this or introduce new events that people might be interested in. You might note that the original PR had some more events when data changes occur, but at the moment I feel the new $watch helper will suffice.

I'm happy to add some tests too, just didn't feel the need to do so at the moment.

/cc @calebporzio @SimoTod @HugoDF

@ryangjchandler
Copy link
Contributor Author

As a further note, I just took the dispatch function for Livewire...

@calebporzio
Copy link
Collaborator

Closing this for now. Added "Alpine events" to the Roadmap for V3 in the Readme

@abinoda
Copy link

abinoda commented Mar 18, 2021

You might note that the original PR had some more events when data changes occur, but at the moment I feel the new $watch helper will suffice.

When does $watch fire? Is it simply after component data is mutated, or is it after the component has been refreshed based on mutated data?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Component lifecycle events
3 participants