Colton Idle07/02/2022, 5:32 PM
Kinda based off of that. Should I store moshi globally? and then do moshi.adapter() at every callsite? Or is the adapter something that should be add() 'd to the moshi instance? edit: actually. maybe that actually doesn't make sense since the callsite needs to know the exact type at the callsite.
val moshi = Moshi.Builder() .addLast(KotlinJsonAdapterFactory()) .build() val testResponse: TestResponse? = moshi.adapter(TestResponse::class.java).fromJsonValue(result.data) return testResponse!!