mostly what I mean is like this ``` val request =...
# rx
u
mostly what I mean is like this
Copy code
val request = apiRequestSingle()
	.map { data -> Result.Success(data) }
	.onErrorReturn { throwable -> Result.Error(throwable)}

request
	.flatMap { result ->
		if(result is ResultSuccess) {
			saveToDatabaseObservble(it)
				.map { result }
		} else {
			Observable.just(result)
		}
	}
	...
vs basically
Copy code
apiRequestSingle()
   .flatMap { data -> saveToDatabaseObservable(data)
                      .map { data }
    }
a
In this example I see no point in wrapping it in a
Result
.
u
but In which would you? I mean, it cannot be a part of the request layer, since then youd be hardcoding the use case into a "general" class