Don't forget to turn off Vue eventBus listeners.
See original GitHub issueYou are making awesome use of the event listeners (e.g. here: https://github.com/zaproxy/zap-hud/blob/develop/src/main/zapHomeFiles/hud/display.js ), but best practice would suggest cleaning up your eventBus listeners with the beforeDestroy hook and calling eventBus.$off
.
For your reference: https://vuejs.org/v2/api/#Instance-Methods-Events
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
where to listen for events using eventBus in vuejs
Most event listeners don't need it because the event that they are listening to either fires when the DOM is ready(so it already...
Read more >Global event bus sets listeners to null on bad code #11104
Vue should keep track of $on/$off listeners and ignore $off if no corresponding $on - at least don't set the listeners array to...
Read more >Using event bus in Vue.js to pass data between components
Essentially, an event bus is a Vue.js instance that can emit events in one component, and then listen and react to the emitted...
Read more >Vue.js: why event bus is bad idea - Lukasz Tkacz Blog
It's ok, because we bind them using… yes, global event bus, they still exist inside it and will work. So, we must always...
Read more >Simple self-detaching event listener I made and use : r/vuejs
It is easy for data to end up in different states if you don't know which events to listen to. You only have...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I absolutely love the HUD and am happy to contribute. Will make a PR las soon as I clean my plate - and plan on integrating this into the Quasar Framework’s app extension family within our testing harnesses.
Reopening as its currently an issue and we dont know when #459 will be merged…