Skip to content

Instantly share code, notes, and snippets.

@alanshaw
Last active December 20, 2015 02:08
Show Gist options
  • Save alanshaw/6053756 to your computer and use it in GitHub Desktop.
Save alanshaw/6053756 to your computer and use it in GitHub Desktop.

Ext's event model is so messed up that I can inadvertantly trigger another run of event processing whilst in the middle of event processing. It means that new events can be triggered and handled whilst half way through processing the current set of events. This is what is happening:

Event handler invoked
Mid way through some code causes Ext to do an event run
    Event handler invoked again
    Event dealt with
Event dealt with

In terms of what I'm dealing with, I get duplicates in the list, because the list is cleared before the event handler is invoked the second time:

List cleared
    List cleared
    Item added
    Item added
Item added
Item added
@olizilla
Copy link

Yeah, that qualifies as bullshit. Gonna have to patch Ext or cruft up your codes with a mutex or...

REFACTOR ALL THE THINGS

@ejber-ozkan
Copy link

Is this GIST public or private?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment