Skip to content

refactor(types): replace 'any' types with explicit types in useSubscription.ts - #1647

Open
Ranjeet2063 wants to merge 1 commit into
rinafcode:mainfrom
Ranjeet2063:fix-types-use-subscription
Open

Ranjeet2063 wants to merge 1 commit into
rinafcode:mainfrom
Ranjeet2063:fix-types-use-subscription

Conversation

@Ranjeet2063

Copy link
Copy Markdown

Description

This PR refactors type definitions in src/hooks/useSubscription.ts to replace loose any types with explicit and type-safe alternatives:

  • deepEqual: Replaced any with unknown with type assertions.
  • UseSubscriptionOptions: Typed data parameter generic TData = unknown.
  • useSubscription & usePollableSubscription: Replaced any default type parameters with TData = unknown, TVariables extends OperationVariables = OperationVariables.
  • Event callback handlers and subscriptions: Added typed ConnectionEvent, typed response payloads, explicit error type narrowing, and typed cleanup references without loose casts.

Closes #1364

Copilot AI balanced review requested due to automatic review settings October 2, 2026 20:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

Replace 'any' types with explicit types in src/hooks/useSubscription.ts

2 participants