davestewart / vue-class-store

Universal Vue stores you write once and use anywhere
https://github.com/davestewart/vue-class-store-demos
MIT License
277 stars 13 forks source link

Practical examples with async #7

Open marfalkov opened 4 years ago

marfalkov commented 4 years ago

Hi Dave! First I would like to Thank You on the great work with vuex-pathify! Vue-class-store is an interesting take! Would love to see practical examples with async data fetching if that is a scope you agree.

Keep up the good work!

davestewart commented 4 years ago

Hey!

Thanks for the kind words and your interest in this project!

Yes, I plan to flesh out the examples and stress-test the idea a bit more.

You should be able to do something with async data right now; just set up a method and populate the model itself.

The main thing I've been thinking for a long time about the idea of "universal stores" and want to see if I can create:

That way it's just one format for stand-alone, component, global or flux stores.

Please comment if you have thoughts!

marfalkov commented 4 years ago

The way I see it you just did that with vue-class-store, the provide-inject usage is great, the flux pattern I'm not even sure is needed here, but who knows? I see that I can do async, you didn't tied the hands of the user to anything and it is a great thing! Thinking about usages with vue-rx and/or xstate. I'll play with it and come back to you if I do have usable thoughts!