title: Why Vue global EventBus do not work in my project
body: <p>I am using vue js in laravel, I need to use the global event bus. I created event-bus.js, and I import it to where I need to use it; when I click, events are generated, but there are no reactions from the listener. I tried everything, but it doesn’t work. Please help me, I have been working for 3 days</p>
  
  <p>I tried to create an eventBus in app.js, but it didn't help either</p>
  
  <p>My EditDiscountComponent</p>
  
  <pre><code>import { EventBus } from "../../../event-bus";
  
  editDiscount () {
          const data = {
            discount_id: this.discountData.discount_id,
            status: this.discountData.status,
            type: this.discountData.type,
            percentage:this.discountData.percentage,
            amount:this.discountData.amount,
          };
  
          EventBus.$emit('update-discount', data);
  
           this.languages.forEach(lang =&gt; {
                if (lang.code &amp;&amp; this.discountData[lang.code] !== undefined) {
                    data[lang.code] = this.discountData[lang.code];
                }
            });
          this.$store.dispatch(actions.EDIT_DISCOUNT, data)
            .then(res =&gt; {
              if (res &amp;&amp; res.data.status) {
  
                // window.location.href = '/admin/discounts';
  
              } else {
                this.$store.commit(mutations.SET_SNACKBAR_SHOW, true);
                this.$store.commit(mutations.SET_SNACKBAR_TEXT, res.data.message);
              }
            }).catch(console.error);
  
        },
      },
  
  </code></pre>
  
  <p>My ProductCOmponent</p>
  
  <pre><code>
  import { EventBus } from "../../../event-bus";
  
   mounted() {
              EventBus.$on('update-discount', ($data) =&gt; {
                  console.log($data);
              });
              this.getCategories();
              this.getProducts();
          },
  </code></pre>
  
  <p>I tried the callback of the function using a different method, but no results, and I tried this listener in the mount (), and this did not help</p>