-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend the actions enumerable with the read operations #798
Labels
enhancement
New feature or request
Comments
Can you show a code example of the usage before creating a PR? |
I don't have any working solution. I would need to get comfortable with the code base before doing any change. :)
|
This feature could also be useful in normal stores and not only on entity stores. But that would probably need a bigger change. :) |
You're welcome to create a PR. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Some store data might only be necessary if we access a specific application page or component. So I would like to fetch the store data from the server only when I need it
Proposed solution
If we try to read data from the store using any of the read methods provided by the query API it should trigger a read action that we could subscribe and if the store is empty we request the data from the server.
I already explored the cache data https://datorama.github.io/akita/docs/additional/cache. But IMHO it seems more useful when we handling static data that we fetch every specific period
Alternatives considered
I already explored the cache data https://datorama.github.io/akita/docs/additional/cache. But IMHO it seems more useful when we handling static data that we fetch every specific period
Currently I use a dedicated service per store to first try to get the data from the store and if store is empty then I execute the backend request. But it's not reliable enough because somewhere else I might try to query data from the store before it was loaded from the server.
Do you want to create a pull request?
Yes
The text was updated successfully, but these errors were encountered: