CachingRecipeRepository
class CachingRecipeRepository(recipeDao: RecipeDao, recipeApiService: RecipeApiService) : RecipeRepository
Implementation of the RecipeRepository interface. It uses a local database and a remote API for managing Recipe data.
Functions
Link copied to clipboard
Deletes a Recipe item from the remote API and the local database.
Link copied to clipboard
Fetches all Recipe items from the local database. If the local database is empty, it refreshes the data from the remote API.
Link copied to clipboard
Inserts a Recipe item into the local database.
Link copied to clipboard
Saves a Recipe item to the remote API and the local database. If the item already exists in the remote API, it updates the item. Otherwise, it creates a new item.
Link copied to clipboard
Updates a Recipe item in the remote API and the local database.