ursus
08/02/2019, 1:45 PMtrevjones
08/02/2019, 3:56 PMdoOn
calls are side effects which announce the status of the download. The single abstraction already provides you with downloading
when it is non terminal, and failed
when the single terminates with onError. idle
is the absence of a single being executed.
also chatRepository seems like an odd place to track attachment download status. the name suggests that it houses chats, not manages stateful interactions for media downloads. is it named properly or is it doing too much?ursus
08/02/2019, 5:14 PMtrevjones
08/02/2019, 5:15 PMursus
08/02/2019, 5:17 PMtrevjones
08/02/2019, 5:26 PMdoOn
functions for something other than logging, I like to stop and ask myself if there is a better way for me to model this into the data type.
in your case the return type is a single so it isn’t bad.chatRepo.doStuff
into the .subscribe
and hopefully contain all of your state mutation signaling to main thread which can really help with keeping behavior predictableursus
08/02/2019, 5:31 PMtrevjones
08/02/2019, 5:34 PMursus
08/02/2019, 5:40 PMpg
08/06/2019, 2:55 PMursus
08/07/2019, 3:46 PMpg
08/07/2019, 3:55 PMursus
08/07/2019, 9:37 PMpg
08/08/2019, 11:53 AM