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

Logic in example #113

Open
JesseLiberty opened this issue Jun 15, 2022 · 0 comments
Open

Logic in example #113

JesseLiberty opened this issue Jun 15, 2022 · 0 comments

Comments

@JesseLiberty
Copy link

Your example checks for offline and if offline returns what is in the barrel but does not check for expired. After that you do check for expired.

//Dev handle online/offline scenario
if(!CrossConnectivity.Current.IsConnected)
{
    return Barrel.Current.Get<IEnumerable<Monkey>>(key: url);
}

//Dev handles checking if cache is expired
if(!Barrel.Current.IsExpired(key: url))
{
    return Barrel.Current.Get<IEnumerable<Monkey>>(key: url);
}

What am I missing? Shouldn't the two checks be combined (if not on line and not expired)

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