DEV Community

Discussion on: Use Vuex? Try this next!

Collapse
 
enguerran profile image
enguerran 🐐💨

When adding an eventListener in JavaScript, the first parameter is a type.

A case-sensitive string representing the event type to listen for.

I understand the intention to keep this approach for redux action or vuex mutation. But the risks of typos are real and difficult to debug. That's why I prefer the "constant" approach and collocalizing the constant is an excellent practice I hadn't thought of.

Thank you for this article.