Moving to the UI code, we would want the usecases to be triggered when specific user-generated or system-generated events happen. Specifically, in the following UI, we would like to:
- Trigger usecases::CheckAvailableGroceries::run as soon as the page which displays the list of grocery items appears, so that we see a full list instead of an empty one
- Trigger usecases::AddGroceryItem::run whenever the user enters an item type in the text field and presses the Add item button
- Trigger usecases::RemoveGroceryItem::run whenever the user presses the X button next to a list entry:
We have already exposed the use case ...