8000 Add predicate to GetAndFetchLatest to determine if a result should be cached. by MFazio23 · Pull Request #397 · reactiveui/Akavache · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add predicate to GetAndFetchLatest to determine if a result should be cached. #397

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

Merged

Conversation

MFazio23
Copy link
Contributor
@MFazio23 MFazio23 commented Dec 4, 2017

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Feature: This adds an optional Func<T, bool> parameter to GetAndFetchLatest(...). This predicate is run on fetched results to determine if those results should be cached. If the predicate exists and the call fails, the data in the cache for a given key will not be invalidated and the fetched result will not be stored.

What is the current behavior? (You can also link to an open issue here)
Whenever a fetch result is returned and does not throw an error, it is put into the cache for the given key.

What is the new behavior (if this is a feature change)?
If the predicate is not sent in, nothing changes from the existing code. If a predicate is entered and the predicate result is false, the fetched data is not stored. Otherwise, data is stored as expected.

Does this PR introduce a breaking change?
No. As the new predicate is optional, users can continue using GetAndFetchLatest(...) without knowing there is a change.

Please check if the PR fulfills these requirements

MFazio23 and others added 4 commits December 4, 2017 15:20
Validate items from fetch function; only include items that return true from validation predicate.
Validate items from fetch function; only include items that return true from validation predicate.
@dnfclas
Copy link
dnfclas commented May 27, 2018

CLA assistant check
All CLA requirements met.

@PureWeen PureWeen changed the base branch from develop to master May 28, 2018 01:53
@glennawatson glennawatson merged commit 7edca23 into reactiveui:master Dec 27, 2018
@glennawatson
Copy link
Contributor

Thanks for doing this @MFazio23 -- been a while but we got there :)

@lock lock bot locked and limited conversation to collaborators Jun 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0