cklmercer / vue-events

Simple event handling for Vue.js
MIT License
234 stars 27 forks source link

Automatic event unsubscribing in Vue 2 when used in options #9

Closed mattmccray closed 7 years ago

mattmccray commented 7 years ago

This pull request will enable automatic event unsubscription when used in this manner:

Test.vue

<template></template>
<script>
export default {
  name: 'test',
  events: {
    disconnected() {
      // Do something here...
    }
  }
}
</script>

Currently the events aren't unsubscribed -- Which is especially a problem when using HMR.

cklmercer commented 7 years ago

sorry! totally let the notification for this slip by me. Looks pretty sweet! Thanks for the contribution.