{"action":"created","issue":{"url":"https://api.github.com/repos/android10/Android-CleanArchitecture/issues/121","repository_url":"https://api.github.com/repos/android10/Android-CleanArchitecture","labels_url":"https://api.github.com/repos/android10/Android-CleanArchitecture/issues/121/labels{/name}","comments_url":"https://api.github.com/repos/android10/Android-CleanArchitecture/issues/121/comments","events_url":"https://api.github.com/repos/android10/Android-CleanArchitecture/issues/121/events","html_url":"https://github.com/android10/Android-CleanArchitecture/issues/121","id":139719877,"number":121,"title":"Composing Use Case observables","user":{"login":"kiwiandroiddev","id":5158190,"avatar_url":"https://avatars.githubusercontent.com/u/5158190?v=3","gravatar_id":"","url":"https://api.github.com/users/kiwiandroiddev","html_url":"https://github.com/kiwiandroiddev","followers_url":"https://api.github.com/users/kiwiandroiddev/followers","following_url":"https://api.github.com/users/kiwiandroiddev/following{/other_user}","gists_url":"https://api.github.com/users/kiwiandroiddev/gists{/gist_id}","starred_url":"https://api.github.com/users/kiwiandroiddev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiwiandroiddev/subscriptions","organizations_url":"https://api.github.com/users/kiwiandroiddev/orgs","repos_url":"https://api.github.com/users/kiwiandroiddev/repos","events_url":"https://api.github.com/users/kiwiandroiddev/events{/privacy}","received_events_url":"https://api.github.com/users/kiwiandroiddev/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/android10/Android-CleanArchitecture/labels/discussion","name":"discussion","color":"5319e7"},{"url":"https://api.github.com/repos/android10/Android-CleanArchitecture/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":34,"created_at":"2016-03-09T22:26:32Z","updated_at":"2016-06-16T08:56:57Z","closed_at":null,"body":"Hi guys, great project, at my company we have based an app on this template and the principles in the accompanying blog post.\r\n\r\nFor some more advanced features in the app, we ran into an issue that is very similar to another one mentioned by @amatkivskiy (https://github.com/android10/Android-CleanArchitecture/issues/63). We would like to be able to compose and combine use cases together to form new use cases.\r\n\r\nAs mentioned, RxJava provides a huge toolbox of operators for composing observables which would be perfect. However, the Use Case interface in this project accepts Subscribers and doesn't expose Observables directly.\r\n\r\nThis makes it awkward to compose and combine use cases with RxJava operators. The approach I went with was first to use Subjects to adapt the subscriber interface into an observable, then to create a new custom observable. This works but isn't great as there's a lot of nesting and boilerplate.\r\n\r\nI was wondering what the reasoning behind the design choice of having Use Cases accept Subscribers rather than returning Observables is? Is it so that Use Cases hide the knowledge of which scheduler is used to subscribe on/observe on? What would be the downsides of having Use Cases return a single Observable?\r\n\r\nI'm still new to using Rx in an Android app architecture, so I'm keen to hear some discussion around this and learn something. Thanks again for contributing this to the community :)"},"comment":{"url":"https://api.github.com/repos/android10/Android-CleanArchitecture/issues/comments/226427440","html_url":"https://github.com/android10/Android-CleanArchitecture/issues/121#issuecomment-226427440","issue_url":"https://api.github.com/repos/android10/Android-CleanArchitecture/issues/121","id":226427440,"user":{"login":"Trikke","id":2961842,"avatar_url":"https://avatars.githubusercontent.com/u/2961842?v=3","gravatar_id":"","url":"https://api.github.com/users/Trikke","html_url":"https://github.com/Trikke","followers_url":"https://api.github.com/users/Trikke/followers","following_url":"https://api.github.com/users/Trikke/following{/other_user}","gists_url":"https://api.github.com/users/Trikke/gists{/gist_id}","starred_url":"https://api.github.com/users/Trikke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Trikke/subscriptions","organizations_url":"https://api.github.com/users/Trikke/orgs","repos_url":"https://api.github.com/users/Trikke/repos","events_url":"https://api.github.com/users/Trikke/events{/privacy}","received_events_url":"https://api.github.com/users/Trikke/received_events","type":"User","site_admin":false},"created_at":"2016-06-16T08:56:57Z","updated_at":"2016-06-16T08:56:57Z","body":"@zoopolitic : glad to help, and yes that's what you should be doing. Your domain data is holy; what comes in from an external source should always be converted to your own data.\r\n\r\n@spirosoik , unfortunately i haven't tried any mapping libs yet. The larger project i maintain has a legacy api with support for Android, iOS and Windows Apps with different data for each platform merged together, it's a mess. So i've got all my mappers written by hand because i know the intricacies of that horrible legacy api. And other personal projects are usually so small that i never bothered checking a mapping lib. But i will check out the example you posted! Maybe it does things just right for me :)"}}
{"actor":{"display_login":"Trikke"}}