ResourceCache

Utility class to automatically manage reading and writing resources from a DataStore as well as providing etag storage support.

Properties

Link copied to clipboard
abstract val etag: String?

Reads the etag that's been stored alongside the resource, if one is available.

Link copied to clipboard
abstract val resource: T?

Reads the resource from disk and and returns it after converting it using the provide DataItemConverter

Functions

Link copied to clipboard
abstract fun saveResource(resource: T, etag: String?)

Saves the resource and its etag into a DataStore for reading later.