Open mhluska opened 5 years ago
Thanks for your suggestions, I should be able to respond to them in detail tomorrow morning!
I use compound documents as well, so this'd definitely be useful. I think it'll take some nontrivial restructuring of the library, because right now each store module is pretty independent, whereas to support compound documents the modules would need to know about one another. I'll think through what changes could be made to support this.
there are two options:
{ root: true }
option OR dynamically attach a new moduleOr, there can be the relationships store module knows the relation of other modules each other.
Currently, related getters of primary resource module are not used. But I think, they should be used to get related resource from the other module.
As is:
To be:
It would be really great if this feature could be implemented; there is a PR for it. It would save a lot of requests / data in my use case
@mrcage I agree; I've run into the same pain point on my own apps.
I've just taken some time to implement a first shot at handling relationships in a way I think fits best with how the library is set up.
@cmygray before I publish the info publicly I'll compare with your PR to see if there's anything from it I want to pull. Thanks for creating that PR as a demonstration that this feature was doable. I haven't included pluralization; I'll consider whether we want to include that separately.
@mrcage @cmygray @mhluska I haven't yet included the documentation in the doc site, but you can see how included records work in #122, in its description and in the tests that it adds. If you'd like to give version 0.1.2
it a try to see if it matches your use case, I'd be happy to know about other things that are needed.
Also I'll give it a try on my own app using reststate-vuex, to try to find any bugs or missing edge cases.
FYI, this library will be unmaintained going forward.
If you need new features or fixes, I recommend forking the repo and making changes, or finding an alternate library that meets your needs.
It would be nice if the library could support compound documents and automatically restructure the data so that I can do
user.todos
ifuser
is my primary resource with includedtodo
resources.