Last active
May 12, 2021 18:42
-
-
Save mitchtabian/71eb95338fc8ca58dc2185c512f15da4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct RecipeListScreen: View { | |
@ObservedObject var viewModel: RecipeListViewModel | |
init(){ | |
self.viewModel = RecipeListViewModel() | |
} | |
var body: some View { | |
List { | |
ForEach(viewModel.state.recipes, id: \.self.id){ recipe in | |
RecipeCard(recipe: recipe) | |
.onAppear(perform: { | |
viewModel.onTriggerEvent( | |
stateEvent: RecipeListEvents.NextPage() | |
) | |
}) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment