-
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
fix: unbound-method lint error by using arrow function syntax for fns declared on the ObservableQueryFields interface #11558
fix: unbound-method lint error by using arrow function syntax for fns declared on the ObservableQueryFields interface #11558
Conversation
🦋 Changeset detectedLatest commit: 50b389d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
size-limit report 📦
|
✅ Deploy Preview for apollo-client-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Confirmed this would impact the docs. Any ideas on how we can make both happy, @phryneas? We could try @jerelmiller's idea of a "fake this" but that would also impact the type that ends up in the docs. |
src/react/types/types.ts
Outdated
@@ -81,9 +81,11 @@ export interface ObservableQueryFields< | |||
TVariables extends OperationVariables, | |||
> { | |||
/** {@inheritDoc @apollo/client!QueryResultDocumentation#startPolling:member} */ | |||
startPolling(pollInterval: number): void; | |||
// startPolling(pollInterval: number): void; | |||
startPolling: ObservableQuery<TData, TVariables>["startPolling"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternative options:
Arrow function
startPolling: ObservableQuery<TData, TVariables>["startPolling"]; | |
startPolling: (pollInterval: number) => void; |
this: void,
startPolling: ObservableQuery<TData, TVariables>["startPolling"]; | |
startPolling(this: void, pollInterval: number): void; |
Thanks @phryneas, this is ready for a final look! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
src/react/types/types.ts
Outdated
@@ -81,11 +81,13 @@ export interface ObservableQueryFields< | |||
TVariables extends OperationVariables, | |||
> { | |||
/** {@inheritDoc @apollo/client!QueryResultDocumentation#startPolling:member} */ | |||
startPolling(pollInterval: number): void; | |||
// startPolling(pollInterval: number): void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// startPolling(pollInterval: number): void; |
I think we could probably get rid of the commented old code 🙂. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, totally overlooked those :) Removed in 556b085
…ds' of github.com:apollographql/apollo-client into 11554-fix-unbound-method-error-on-observablequery-methods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢 it
Closes #11554.