DEV Community

Discussion on: Vue over React just for the syntaxis? :(

 
vonheikemen profile image
Heiker

Interesting.

As far as I know redux uses a similar convention. When you call dispatch you must pass an object with a type property. That type property doesn't have to be a string but it is strongly recommended that you make it a string. Why would it be such an inconvenience in vuex? Is it really because they are methods?

Thread Thread
 
cyberhck profile image
Nishchal Gautam • Edited

What happens when you call a mutation which doesn't exists? With redux it's that way because by default you return current state, and if I'm writing with typescript, I can even get typescript on those stringy values (just need to write types correctly). With vuex, if they had something like: commit(mutation.increment) that'd be much better.

That's the biggest reason I switched back from vue to react, close but second biggest reason is lack of similar level of typescript support. Because of templates, for some reason vue has less typescript coverage (similar to angular)

You can compare all 3 projects, even though react internally isn't written in typescript (yet), it has the best typescript support.