Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
DealPresenterV1 - TP Article
public class DealPresenter {
@VisibleForTesting Deal deal;
private DealUtil dealUtil;
private DealApiClient dealApiClient;
private WishlistManager wishlistManager;
private DealViewStateModel dealViewStateModel;
public DealPresenter(DealUtil dealUtil, DealApiclient dealApiClient, WishlistManager wishlistManager, DealViewStateModel dealViewStateModel) {
this.dealUtil = dealUtil;
this.dealApiClient = dealApiClient;
this.wishlistManager = wishlistManager;
this.dealViewStateModel = dealViewStateModel;
}
...
public void onWishlistSelected() {
   if (dealUtil.isWishlistEnabled(deal)) {
     wishlistManager.addDealToWishlist(deal.dealId);
   }
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment