davestewart / vuex-pathify

Vue / Vuex plugin providing a unified path syntax to Vuex stores
https://davestewart.github.io/vuex-pathify
MIT License
1.37k stars 57 forks source link

Why the @ for path access is needed?!? #142

Open pate313373 opened 2 years ago

pate313373 commented 2 years ago

Hi!

I have previously used vuex-map-fields, which is even simpler than this library. With vuex-map-fields, I could access a nested prop of an object just by using ".", here I need the "@".

I don't see any benefit in this syntax. I'm just wondering, if it wouldn't be better to simplify the path syntax in a next major release....

Kind regards

PS: Really like your library! Otherwise, I would still use vuex-map-fields.

davestewart commented 2 years ago

Hey!

Yes, I've thoughts similar.

At the time I think I decided it would be a good idea to be explicit.

Some developers will jump on "time saving" libraries, and at the time there was terrific disagreement about the "best way" or the "right way" to do Vuex / Flux.

I didn't want to risk the library being "rejected" so that was the decision I took.

By the way, have you tried using just a . ? I can't remember if I coded it to allow both or not...

pate313373 commented 2 years ago

Cool, happy you have similar thoughts! I am not sure at all, but I think it's possible partially. So if I remember right, there are a few functions, which don't allow using "." only. - I'll keep you posted.

Thanks for the nice library, really like it so far. :)