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

Passing context to data module? #4

Closed
droidwithme opened this issue Aug 20, 2021 · 1 comment
Closed

Passing context to data module? #4

droidwithme opened this issue Aug 20, 2021 · 1 comment
Assignees
Labels
help wanted Extra attention is needed

Comments

@droidwithme
Copy link

Hello DrJacky,
Thanks for the amazing tutorial on clean architecture.
I am using this repo so far. but recently I wanted to check internet connectivity to check if user is offline, it yes then fetch data from database else from api.
To do that I need context in my repositoyimpl, How to do that?

@Drjacky
Copy link
Owner

Drjacky commented Aug 20, 2021

@droidwithme The best practice could be that you do the network request, get the UnknownHostException or SocketTimeoutException, then on the Presentation layer, you act based on that.

This repo is old. I'd suggest taking a look into https://github.com/Drjacky/MVVMTemplate

@Drjacky Drjacky closed this as completed Aug 20, 2021
@Drjacky Drjacky self-assigned this Aug 20, 2021
@Drjacky Drjacky added the help wanted Extra attention is needed label Aug 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants