changeListSync

suspend fun Synchronizer.changeListSync(model: String, changeListFetcher: suspend (currentVersion: Int) -> List<NetworkChangeList>, modelDeleter: suspend (ids: List<String>) -> Unit, modelUpdater: suspend (ids: List<String>) -> Unit): Boolean

Utility function for syncing a repository with the network. model Model that needs to be synced changeListFetcher Fetches the change list for the model modelDeleter Deletes models by consuming the ids of the models that have been deleted. modelUpdater Updates models by consuming the ids of the models that have changed.

Note that the blocks defined above are never run concurrently, and the Synchronizer implementation must guarantee this.


suspend fun Synchronizer.changeListSync(models: List<String>, changeListFetcher: suspend (model: String, currentVersion: Int) -> List<NetworkChangeList>, modelDeleter: suspend (model: String, ids: List<String>) -> Unit, modelUpdater: suspend (model: String, ids: List<String>) -> Unit): Boolean

Utility function for syncing a repository with the network. models List of models that needs to be synced changeListFetcher Fetches the change list for the model modelDeleter Deletes models by consuming the ids of the models that have been deleted. modelUpdater Updates models by consuming the ids of the models that have changed.

Note that the blocks defined above are never run concurrently, and the Synchronizer implementation must guarantee this.