title: Going offline with nativescript app and database syncing
body: <p>I have a NativeScript (angular) app that currently makes API-calls to a server to get data.</p>
  
  <p>I would like to implement something that does a bi-directional synchronization once a device gets online but using my current API. No BaaS.</p>
  
  <p>The first solution that came to my mind is to do a sort of caching. Once in a while, the app invalidates the info in the DB and fetches it again. I don't like this approach because there are big lists (that may change. They are fetched in batches, i.e. by page. One of them is a list of files that are downloaded and stored on a device. So I have to keep those that are still in the list, and delete those that are not. It sounds like a nightmare.</p>
  
  <p>How would you solve such problem?</p>