-
Notifications
You must be signed in to change notification settings - Fork 290
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
Does the currentEvent variable make a sense in Inner Invoke? #1191
Comments
I think you are correct that we could simplify this. Because global's current event is always initially undefined and nothing but these steps manipulate it. This was introduced in #407. @miketaylr do you happen to recall the thinking here? |
Oh wait. Never mind. I think this makes sense when the listener dispatches another event. In that case there will be a current event. |
@annevk nested events right? In that case it make sense, you're right. document.body.addEventListener("click", (e) => {
e.currentTarget.dispatchEvent(new CustomEvent("hello"))
}) |
Yep. |
Now we have this:
Can we short into this:
I wondered because
currentEvent
always hasundefined
value. Do we have a case when this reduction could break the logic?The text was updated successfully, but these errors were encountered: