Order of events

Quick question: if two event listeners are added, both for the same event but one using JS and the other Python, is there an order in which they will trigger? For instance, if I have a button with js_on_click and on_click, in what order will they trigger? In my brief testing it appears as though JS events will trigger first, followed by Python callbacks (regardless of the order in which they were added). Is this behavior guaranteed, or might there be a hidden race occurring?

This is not defined. In practice, given that a Python trip requires a network round-trip and exectution of Python code, I would generally expect the JS callback to execute first (~immediately). But there are probably ways in which this can fail to be true, and we do not make any guarantees either way.

Thanks for the reply! That’s good to know!