Implement client ConnectionState, satirical idle sayings, response cycling, and complete MVVM/Compose multiplatform scaffolding
This commit is contained in:
@@ -319,6 +319,7 @@ object SDUIJson {
|
||||
ignoreUnknownKeys = true
|
||||
prettyPrint = true
|
||||
classDiscriminator = "type"
|
||||
encodeDefaults = true
|
||||
}
|
||||
|
||||
fun encodeToString(primitive: UiPrimitive): String {
|
||||
@@ -349,3 +350,16 @@ fun String.toWebSocketPayload(): WebSocketPayload = SDUIJson.json.decodeFromStri
|
||||
|
||||
fun ApprovalResponse.toJson(): String = SDUIJson.json.encodeToString(this)
|
||||
fun String.toApprovalResponse(): ApprovalResponse = SDUIJson.json.decodeFromString(this)
|
||||
|
||||
@Serializable
|
||||
data class UserProfile(
|
||||
val id: String,
|
||||
val name: String,
|
||||
val description: String? = null,
|
||||
val layout: UiPrimitive
|
||||
) {
|
||||
fun toJson(): String = SDUIJson.json.encodeToString(this)
|
||||
}
|
||||
|
||||
fun String.toUserProfile(): UserProfile = SDUIJson.json.decodeFromString(this)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user