My app is a social media clone app. I want a logic like below for my home feed:
amplify api will fetch list of 10 items through pagination -> this 10 items will be showing up to user in feed -> when user reaches the 7th item on the screen I will fetch again 10 items through api call and save it to local datastore-> when user will reach the end item/10th item i will show the next 10 items present in local datastore and I will clear that 10 items in local storage-> and fetch next 10 items-> if user closes app immediately the 10 items will be there in local storage-> next time when user will open app I will show the data without buffer form local storage
My issue is how if user likes a post or makes a comment I will save that to data store for short time and when sync event occurs I will update that like and comment to DynamoDB.
1. My question is how to delete some specific data when some event occurs like list of post?