divyanshunegi
07/14/2021, 5:17 PMtry {
success.invoke(Json.decodeFromString(T.serializer(), result) as T)
} catch (ex: SerializationException) {
error.invoke(Json.decodeFromString(K.serializer()!!, result) as K)
} catch (ex: SerializationException) {
error.invoke((Json.decodeFromString(GenericSerializer!!, result) as GenericError))
}
I have these T
and K
classes passed to this function, as reified, how can I create a serialiser object from these ? coming from a JS background, pardon me if I am trying to do something Bizarre here