Currently events are just strings and their properties are passed as additional parameters to dispatch. This can lead to hard and unmaintainable code.
We should change it to objects with type property, so they could be generated with function. Functions presence and identity can be statically checked with linters.
Old (bad):
store.dispatch('add-item', item);
New (good):
const addItem = (item) => {
return {
type: 'add-item',
item
};
};
store.dispatch(addItem(item));