This might be a dumb question, but I’m just curious about what’s considered best practice. I have a fragment that is supposed to display a QR code. It first queries a server for a token-string, generates a bitmap from the response, and then displays it in a view. Caveat is that drawing the bitmap from an input string takes about a second or two. My question is thus, what’s appropriate to store in the state?
I’m thinking of just storing the tokenString in the state and having an asyncSubscribe to begin drawing the bitmap on success, but I could see how this impacts the ability to perform unit tests. I could also store the bitmap in the state, but that feels very heavy for the state.
data class FooBarState(
val token: Async<String> = Uninitialized
) : MvRxState