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

Support optimistic.forget to remove Entry objects from Cache. #84

Merged
merged 3 commits into from
Oct 13, 2020

Conversation

benjamn
Copy link
Owner

@benjamn benjamn commented Oct 13, 2020

This method takes the same arguments as optimistic.dirty and optimistic.peek (TKeyArgs, as opposed to the full TArgs that the optimistic function itself takes). This distinction means you can remove entries as long as you have TKeyArgs, even if you don't have TArgs.

Like Map.prototype.delete and friends, optimistic.forget returns a boolean to indicate whether an entry was deleted.

This new API should enable a straightforward solution for apollographql/apollo-client#7149 and apollographql/apollo-client#7086.

@benjamn benjamn self-assigned this Oct 13, 2020
This method takes the same arguments that optimistic.dirty and
optimistic.peek take (TKeyArgs, as opposed to the full TArgs that the
optimistic function itself takes). This distinction means you can remove
entries as long as you have TKeyArgs, even if you don't have TArgs.

Like Map.prototype.delete and friends, optimistic.forget returns a boolean
to indicate whether an entry was deleted.
@benjamn benjamn merged commit cda0228 into main Oct 13, 2020
@benjamn benjamn deleted the optimistic.forget branch October 13, 2020 17:05
benjamn added a commit that referenced this pull request Oct 13, 2020
The minor version bump is due to the (fully backwards-compatible) addition
of the optimistic.forget method in #84.
benjamn added a commit to apollographql/apollo-client that referenced this pull request Oct 13, 2020
benjamn added a commit to apollographql/apollo-client that referenced this pull request Oct 13, 2020
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

Successfully merging this pull request may close these issues.

None yet

1 participant