Anybody else bothered by using flatmaps for sequen...
# rx
u
Anybody else bothered by using flatmaps for sequential code? Like logout?
Copy code
fun logout() {
   api.logout()
   userDb.removeUser()
   userPrefs.remove()
   etc.
}
I've seen people do like
Copy code
fun logout(): Single ... {
   api.logoutSingle()
   .flatmap { userDb.removeUserSingle() }
   .flatmap { userSettings.removeSingle() }
}
or `andThen`s if Completable To me this doesnt make sense, since its inherently sequential. If my Api returned singles, would it be criminal to use api.logout().blockingGet() and then sync. versions of the other 2 functions, and wrap it all in Single.fromCallable? And also, in the flatmap chains I have to worry about atomicity. i.e. chain could be unsubbed half way and my settings wont get cleared etc. Having it single sync. function would prevent it