Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.
This repository was archived by the owner on May 1, 2025. It is now read-only.

Extend the actions enumerable with the read operations #798

@jgomesmv

Description

@jgomesmv

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions