Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decouple Respository logic #92

Open
jbatra-umeey opened this issue Nov 6, 2023 · 1 comment
Open

Decouple Respository logic #92

jbatra-umeey opened this issue Nov 6, 2023 · 1 comment

Comments

@jbatra-umeey
Copy link

jbatra-umeey commented Nov 6, 2023

Greetings @nalexn,

I'm currently working on the task of disentangling the database/Appstate from the CountriesInteractor. However, it appears that the two are closely intertwined. Could you kindly provide some guidance on how to achieve this separation, or if there are any sample examples available without this coupling, that would be greatly appreciated?

I went through the below description and it seems Appstate is available by default

Previously, this app did not use CoreData for persistence, and all loaded data were stored in the AppState.

With the persistence layer in place we have a choice - either to load the DB content onto the AppState, or serve the data from Interactors on an on-demand basis through Binding.

The first option suits best when you don't have a lot of data, for example, when you just store the last used login email in the UserDefaults. Then, the corresponding string value can just be loaded onto the AppState at launch and updated by the Interactor when the user changes the input.

@jbatra-umeey jbatra-umeey changed the title Sample without dbRepository Decouple Respository logic Nov 6, 2023
@nalexn
Copy link
Owner

nalexn commented Nov 6, 2023

Yep, did you check that v1 of the app under the "previously" link? It did not use core data and was using app state solely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants