If I have an ajax call off fetching (with a callback) and then some other code running in the meantime. How can I have a third function that will be called when both of the
Something like this (schematic):
registerThread() { counter++; } unregisterThread() { if (--counter == 0) fireEvent('some_user_event'); } eventHandler_for_some_user_event() { do_stuff(); }