Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Mono2Clean - HomePresenter example
public class HomePresenter implements IHomePresenter{
private IHomeView mView;
private IPostService mService;
private IMapper<Post,PostView> mPostMapper;
private IMapper<Comment,CommentView> mCommentMapper;
public HomePresenter(IHomeView mView, IPostService mService, IMapper<Post, PostView> mPostMapper, IMapper<Comment, CommentView> mCommentMapper) {
this.mView = mView;
this.mService = mService;
this.mPostMapper = mPostMapper;
this.mCommentMapper = mCommentMapper;
public void loadPost(final int postId){
.map(new Func1<Post, PostView>() {
public PostView call(Post post) {
return mPostMapper.transform(post);
.subscribe(new Subscriber<PostView>() {
public void onCompleted() {}
public void onError(Throwable e) {
public void onNext(PostView postView) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment