Skip to content

Instantly share code, notes, and snippets.

Created June 25, 2017 16:32
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
class RecipePresenter {
Model model;
View view;
List<Recipe> list;
RecipeData data;
// Make the constructor here and initialize the model and view
/* First and second role of presenter- asking model for data
on button click. Caching the recipes in 'data' variable and
then sending the results back */
void loadRecipes() {
try {
list = model.onLoadRecipes();
} catch (UpgradeAccountException exception) {
// Third role of presenter - transform data
void loadFilterRecipe() {
List<Recipe> filterList = list.someFilter();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment