Skip to content

Instantly share code, notes, and snippets.

@bansalayush
Created February 19, 2019 19:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bansalayush/25749a086c7a237ab10f322afff98e2f to your computer and use it in GitHub Desktop.
Save bansalayush/25749a086c7a237ab10f322afff98e2f to your computer and use it in GitHub Desktop.
Repository pattern
It gives software developers a mediation layer between the domain of the application and the raw data fetched
from the data source.
Repository pattern is a great idea, and it’s what Store is based on: instead of accessing the network layer directly,
the library should be invoked, giving a wide range of benefits.
One of them is the possibility of persisting the data so that it can be accessed while offline.
This brings us to the next step, the record duration policy: within Store it’s possible to declare how long the data
should persist.
There is control over whether to fetch fresh data when what’s currently on disk is stale, or not.
Store also provides total freedom on how to fetch, parse and persist data, while still giving good defaults.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment