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

fix: unbound-method lint error by using arrow function syntax for fns declared on the ObservableQueryFields interface #11558

Merged
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

[context.deploy-preview.build]
base = "docs"
ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF ."
ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF"
command = """\
npm i
npm run docmodel
Expand Down
6 changes: 4 additions & 2 deletions src/react/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@ export interface ObservableQueryFields<
TVariables extends OperationVariables,
> {
/** {@inheritDoc @apollo/client!QueryResultDocumentation#startPolling:member} */
startPolling(pollInterval: number): void;
// startPolling(pollInterval: number): void;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// startPolling(pollInterval: number): void;

I think we could probably get rid of the commented old code 🙂. What do you think?

Copy link
Contributor Author

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

startPolling: ObservableQuery<TData, TVariables>["startPolling"];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternative options:

Arrow function

Suggested change
startPolling: ObservableQuery<TData, TVariables>["startPolling"];
startPolling: (pollInterval: number) => void;

this: void,

Suggested change
startPolling: ObservableQuery<TData, TVariables>["startPolling"];
startPolling(this: void, pollInterval: number): void;

/** {@inheritDoc @apollo/client!QueryResultDocumentation#stopPolling:member} */
stopPolling(): void;
stopPolling: ObservableQuery<TData, TVariables>["stopPolling"];
// stopPolling(): void;
alessbell marked this conversation as resolved.
Show resolved Hide resolved
/** {@inheritDoc @apollo/client!QueryResultDocumentation#subscribeToMore:member} */
subscribeToMore<
TSubscriptionData = TData,
Expand Down
Loading