Vuejs

// You have to $off the event to avoid this multiple call

created() {
    EventBus.$on('confirm-delete-category-a', (id) => {
      this.confirmDelete(id);
    }),
 destroyed() {
            EventBus.$off('confirm-delete-category-a');
        },
Lioruby