Instantly share code, notes, and snippets.

Embed
What would you like to do?
package com.illuzor.lesson.wallpapers.model
import androidx.lifecycle.ViewModel
abstract class ViewModelBase : ViewModel() {
enum class State { CREATED, PROGRESS, LOADED, ERROR }
var state = State.CREATED
protected set
protected lateinit var loadListener: () -> Unit
fun setListener(loadListener: () -> Unit) {
this.loadListener = loadListener
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment