teller / com.levibostian.teller.repository / OnlineRepository / requirements

requirements

var requirements: GET_DATA_REQUIREMENTS?

Requirements needed to be able to load cached data from the device and to fetch new cached data from the network.

When this property is set, the OnlineRepository instance will begin to observe the cacheData by loading the cached data on the device and checking if it needs to fetch fresh data from the network. All of the work will be done for you.

If the user decides to scroll to the next page of data, view a different user profile, or any other reason you need to change to observe a different piece of data, just set requirements again.

If requirements is set to null, we will stop observing the cache changes and reset the state of data to null.