Skip to content
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

How to invalidate cache after a create, update or delete operation? #1005

Open
Sefibrah opened this issue Nov 19, 2022 · 1 comment
Open

Comments

@Sefibrah
Copy link

Sefibrah commented Nov 19, 2022

Can someone provide me an example, or explanation, of how to invalidate my cache, or to re-fetch data for the currently selected filters when i perform create, update or delete operations, I am in desperate need :(

For eg., I have a row with a delete button on it. When I click it, nothing changes, but when i refresh it does change...

Angular 13 & Akita 7

@karlatt
Copy link

karlatt commented Jan 9, 2023

This is not an akita but an angular feature you're missing . For example (and simplicity) You can use an async pipe with an observable you select from the query when you set your datatable datasource. Then , if you do correct updates/delete, etc, everything will be "automagic". If you use a smart/dumb architecture the async pipe can be on your dumb component @input . The async pipe subscribes to the observable AND unsubscribes when the component gets destroyed , this is the only thing you need

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants