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

Bypass fetch network call if there's no new data to fetch #18

Open
iamgabrielma opened this issue Aug 5, 2021 · 0 comments
Open

Bypass fetch network call if there's no new data to fetch #18

iamgabrielma opened this issue Aug 5, 2021 · 0 comments

Comments

@iamgabrielma
Copy link
Owner

iamgabrielma commented Aug 5, 2021

I can save the [Stock]() fetched stock data in some sort of "persistent" object in the app, by the size of it I can just use UserDefaults and then make URLSession.shared.dataTask task to only execute if there's actually new data to fetch, for example by comparing the datetime from last fetch, if does not pass the check I can bypassing the network call and just output the previously saved object.

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

1 participant