title: How to listen to all custom events in VueJS?
body: <p>In my VueJS app I have a Vue instance which I'm using as an event bus for sending data between components.</p>
  
  <p>It's just this:</p>
  
  <pre><code>import Vue from 'vue';
  export const EventBus = new Vue();
  </code></pre>
  
  <p>Then in my components I import EventBus and use <code>EventBus.$emit()</code> and <code>EventBus.$on()</code>.</p>
  
  <p>This approach is explained here: <a href="https://alligator.io/vuejs/global-event-bus/" rel="nofollow noreferrer">https://alligator.io/vuejs/global-event-bus/</a></p>
  
  <p>What I'd like to be able to do is listen to any event that is sent through EventBus. If I could bind one listener to all events I could use this for logging or to feed data into some system for my development environment that would show me all data as it went into eventBus, which would be super useful.</p>
  
  <p>Is there any type of <code>vm.$listenToEverything()</code> that I'm missing or some way to make this work?</p>