Skip to content

Update event manager to allow recursive firing#1667

Merged
ricksbrown merged 1 commit intoBorderTech:georgiefrom
ricksbrown:custom-events
Sep 23, 2019
Merged

Update event manager to allow recursive firing#1667
ricksbrown merged 1 commit intoBorderTech:georgiefrom
ricksbrown:custom-events

Conversation

@ricksbrown
Copy link
Copy Markdown
Member

@ricksbrown ricksbrown commented Sep 23, 2019

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.

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.
@ricksbrown ricksbrown merged commit 19fcacf into BorderTech:georgie Sep 23, 2019
@ricksbrown ricksbrown deleted the custom-events branch October 2, 2019 20:11
@ricksbrown ricksbrown restored the custom-events branch October 2, 2019 20:11
@ricksbrown ricksbrown deleted the custom-events branch October 31, 2019 21:19
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.

1 participant