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

Add an example of code without pathify vs with pathify #66

Open hitautodestruct opened 5 years ago

hitautodestruct commented 5 years ago

Coming in from heavy use of vuex in an app I'm working on it took me a while to understand why I needed pathify.

I found it very hard to understand how pathify reduces my code until I found this post comparing regular vuex methods to pathify.

I would suggest you add at least one such example on the pathify 101 page or a similar introductory page.

davestewart commented 5 years ago

That's a good suggestion.

I've really struggled with keeping the docs to a minimum on this lib, but I think that could be helpful.

There are examples dotted throughout the docs, but you're looking for just a single place, perhaps:

?

hitautodestruct commented 5 years ago

Yes, although it could just be one direct comparison on the pathify 101 page.

I found some direct comparisons of pathify vs vuex methods on the components helpers page.

Basically I was looking for the equivalent vuex code, because thats what I know and where I come from. Once, I saw the comparison it was clear what pathify does.

WhiteBookmark commented 5 years ago

Shouldn't this be closed ? I already see examples of vuex equivalent code in docs.

hitautodestruct commented 5 years ago

@WhiteBookmark Yes, if you dig deep you will see examples. I am trying to make the point that initially it is very unclear as to what pathify gives you when readin g the intro and 101.

davestewart commented 5 years ago

I'm happy to add another section with some basic examples.

It's really hard to get the level of detail right in the docs. I always aim to keep them lean, but always end up writing much more than I would like to have, hence it becomes harder to find things.

In an ideal world, I'd make the docs leaner, but I doubt that will happen, so this is a good compromise.

julie777 commented 3 years ago

Keeping the docs simple and short is admirable. However as a new user exploring, it is verying important that the first thing they read in the readme on GitHub or on NPM includes enough to make them think it will be useful and worthwhile for them. I am all for adding a simple "pathify lets you go from ... to ... and that is why you should try it. Seeing the actual code change it huge.

For me seeing what <script setup> does in Vue 3 made me an instant convert. I hate having to sift through a bunch of code details to extract the meaning, especially when there is a simple way that makes the intent more obvious.