This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "My First Page", | |
"parameters": [], | |
"version": 1, | |
"children": [ | |
{ | |
"name": "Widget", | |
"description": { | |
"comment": "Aqui vai alguma descrição" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import androidx.lifecycle.MutableLiveData | |
sealed class Outcome<T> { | |
data class Progress<T>(var loading: Boolean) : Outcome<T>() | |
data class Success<T>(var data: T) : Outcome<T>() | |
data class Failure<T>(val e: Throwable) : Outcome<T>() | |
data class Error<T>(val message: String) : Outcome<T>() | |
companion object { | |
fun <T> loading(isLoading: Boolean): Outcome<T> = Progress(isLoading) |