title: How to chain event listener in same stack
body: <p>I have an event listener for button click that fires off another event. This second event makes some API calls and then returns a third event with loaded data when complete. This works well, but I need to make the events all execute in the same context as the button click event.</p>
  
  <p>The use case for this is playing audio media on a website. On iPhone, Apple imposes limitations on bandwidth heavy consumption by ensuring a load event for media is only accepted when it's tied to a user event (such as button click). With my current event queue, the 3rd event tries to execute a media load, but is prohibited, because it's interpreted as not being tied to any user event, but rather an async call coming from a script.</p>
  
  <p>EDIT: Code included, I'm using a library called livewire which has it's own global event system.</p>
  
  <p>Event 1: Button click</p>
  
  <pre><code>$(document).on('click', '.play', function () {
      window.livewire.emit('playSong', songId);
  });
  </code></pre>
  
  <p>The emitted livewire event uses it's internal library to communicate with my server. My server response back with a payload and an event to execute that we listen to in the same client side JS.</p>
  
  <p>Event listener:</p>
  
  <pre><code>window.livewire.on('songLoaded', function (song) {
     // player loads the song URL and plays
     player.src = song.source;
     player.load();
     player.play()
  });
  </code></pre>
  
  <p>Because my listener is technically outside the event scope of the original button click, iOS has no way of knowing this event was fired in response to the button click, so it denies the request to set the src and load the audio file.</p>