Skip to content

Instantly share code, notes, and snippets.

@jianxiansiqi47
Last active October 3, 2017 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jianxiansiqi47/b3549743a960ace755a0b2e3584a893e to your computer and use it in GitHub Desktop.
Save jianxiansiqi47/b3549743a960ace755a0b2e3584a893e to your computer and use it in GitHub Desktop.
DealPresenterV2 - TP article
public class DealPresenter {
@VisibleForTesting Deal deal;
@Inject DealUtil dealUtil;
@Inject DealApiClient dealApiClient;
@Inject DealViewStateModel dealViewStateModel;
@Inject WishlistManager wishlistManager;
// We do not need the constructor anymore
...
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