ton of refactoring, dropped lustre for a wasm frontend in rust

This commit is contained in:
2025-05-07 19:38:31 -06:00
parent 76522cc053
commit 91547b9c2e
18 changed files with 543 additions and 224 deletions
+8 -8
View File
@@ -21,14 +21,14 @@ pub fn serialize(session: Session) -> json.Json {
])
}
pub fn deseralize(json_string: String) -> Result(Session, json.DecodeError) {
let session_decoder = {
use id <- decode.field("id", decode.int)
use host_user_id <- decode.field("host_user_id", decode.int)
use players <- decode.field("players", decode.list(player.decoder()))
pub fn decoder() -> decode.Decoder(Session) {
use id <- decode.field("id", decode.int)
use host_user_id <- decode.field("host_user_id", decode.int)
use players <- decode.field("players", decode.list(player.decoder()))
decode.success(Session(id:, host_user_id:, players:))
}
decode.success(Session(id:, host_user_id:, players:))
}
json.parse(from: json_string, using: session_decoder)
pub fn deseralize(json_string: String) -> Result(Session, json.DecodeError) {
json.parse(from: json_string, using: decoder())
}