Update event manager to allow recursive firing#1667
Merged
ricksbrown merged 1 commit intoBorderTech:georgiefrom Sep 23, 2019
ricksbrown:custom-events
Merged
Update event manager to allow recursive firing#1667ricksbrown merged 1 commit intoBorderTech:georgiefrom ricksbrown:custom-events
ricksbrown merged 1 commit intoBorderTech:georgiefrom
ricksbrown:custom-events
Conversation
The event manager used to only allow one event of any kind to fire at a time, e.g. "click" would not fire while "change" was processing. Then we relaxed it so that click would only prevent other clicks from firing. Subsequent calls would be queued until the next event loop. This was to prevent infinite event recursion but it comes at a cost. I think we could completely do away with this protection but there is a chance that bad code exists since we have been guarding it forever. This change allows some recursion and I'm pretty sure it will allow 100% of legitimate cases to process synchronously whilst only pushing potentially buggy code to the next event loop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The event manager used to only allow one event of any kind to fire
at a time, e.g. "click" would not fire while "change" was processing.
Then we relaxed it so that click, for example, would only prevent other clicks from
firing. Subsequent calls would be queued until the next event loop.
This was to prevent infinite event recursion but it comes at a cost.
I think we could completely do away with this protection but there is
a chance that bad code exists since we have been guarding it forever.
This change allows some recursion and I'm pretty sure it will allow
100% of legitimate cases to process synchronously whilst only pushing
potentially buggy code to the next event loop.