Last active
July 18, 2022 15:24
-
-
Save chrsp/1ce93ca1a1b2e25dc9a9022627fca018 to your computer and use it in GitHub Desktop.
This file contains 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
// Module: Data | |
import Domain | |
public struct KitchenLocalDataSource: KitchenLocalRepository { | |
public func getIngredients(_ recipe: Recipe) -> [Ingredient]? { | |
// do something to fetch the ingredients needed from some local store: UserDefaults, CoreData, Memory Cache, KeychainManager etc | |
} | |
} | |
public struct KitchenRemoteDataSource: KitchenRemoteRepository { | |
public func getIngredients(_ recipe: Recipe, completion: ([Ingredient]?) -> Void)) { | |
// do something to fetch the ingredients needed from some remote store, usually calling your NetworkManager here | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks a lot for quick reply sir.
I am still a bit confused in Importing, It would be really helpful for me if you could please send me the finished project possibly.
Here I am - [email protected]