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

Enable Event capturing #719

Merged
2 commits merged into from
Nov 22, 2022
Merged

Enable Event capturing #719

2 commits merged into from
Nov 22, 2022

Conversation

jamowei
Copy link
Collaborator

@jamowei jamowei commented Nov 3, 2022

It is now possible to listen on events in capture-phase (suffixed by Captured):

render {
    div {
        clicksCaptured handledBy store.save
    }
}

For this we added new options to the subscribe() function which gives you a Listener for your event:

subscribe<Event>(name: String, capture: Boolean, init: Event.() -> Unit)

Using the init-lambda you can make settings to the captured event that have to be applied immediately.

We also fixed a bug when using stopPropagation() on a Listener which sometime did not work as expected.

fixes #552

@jamowei jamowei added this to the 1.0-RC2 milestone Nov 3, 2022
@jamowei jamowei requested a review from jwstegemann November 3, 2022 20:17
@jamowei jamowei self-assigned this Nov 3, 2022
@ghost ghost self-requested a review November 22, 2022 15:59
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very good!

The tests are running and the code looks clean.

@ghost ghost merged commit eaa0b06 into master Nov 22, 2022
@ghost ghost deleted the jamowei/event-capturing branch November 22, 2022 16:01
This pull request was closed.
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.

Enable Event Capturing supplementary to Event Bubbling (Default and only Method so far)
1 participant