-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Add an ignoreResults
option to the useSubscription
API
#10216
Comments
ignoreResults
option to the useSubscription
APIignoreResults
option to the useSubscription
API
ignoreResults
option to the useSubscription
APIignoreResults
option to the useSubscription
API
+10000 |
This has been implemented in #11921 and will be released in Apollo Client 3.11. |
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Overview
Some issues have been brought to our attention that the
useSubscription
API doesn't have an option of ignoreResults, similar to theuseMutation
API.Issue
Unfortunately, unlike
useMutation
, there is no "magic parameter" likeignoreResults
, and a component will be rendered each time you get new data on subscription.useSubscription
returns a value, and because it does, that means we need to update it, which requires components to re-render. WhereasuseMutation
allows someone to avoid the re-renders by passing anignoreResults
option.Purpose
We could offer an
ignoreResults
option inuseSubscription
which would not return a value fromuseSubscription
thereby avoiding re-renders This would be useful to allow a developer to to not re-render a component on certain occasions if they wish.Details
References
The text was updated successfully, but these errors were encountered: