Skip to content

feat(client + react-query): add subscription state - #5908

Closed
BeBoRE wants to merge 42 commits into
nextfrom
subscription-connection-state
Closed

BeBoRE wants to merge 42 commits into
nextfrom
subscription-connection-state

Conversation

@BeBoRE

@BeBoRE BeBoRE commented Jul 22, 2024 •

Copy link
Copy Markdown
Contributor

Replaces #5886

Closes #5871
Closes #5786

🎯 Changes

βœ… Checklist

  • I have followed the steps listed in the Contributing guide.
  • If necessary, I have added documentation related to the changes made.
  • I have added or updated the tests related to the changes made.

…on-state

# Conflicts:
#	packages/client/src/links/httpSubscriptionLink.ts
Comment on lines +216 to +238
/**
* Is `true` when the subscription is establishing the initial connection
*/
isStarting: boolean;
/**
* Is `true` when the subscription has successfully connected at least once
*/
isStarted: boolean;
/**
* Is `true` if the subscription is (re-)establishing a connection
* - Alias for `status === 'connecting'`
*/
isConnecting: boolean;
/**
* Is `true` when the subscription is connected and listening for data
* - Alias for `status === 'pending'`
*/
isPending: boolean;
/**
* Is `true` if the subscription is re-establishing a connection
* - Alias for `status === 'connecting' && isStarted === true`
*/
isReconnecting: boolean;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we can ditch all of these and force people to use status

@KATT
KATT requested a review from Nick-Lucas August 2, 2024 15:19
@KATT KATT changed the title Subscription hook return subscription info feat(client + react-query): add subscription state Aug 2, 2024
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been locked because we are very unlikely to see comments on closed issues. If you think, this PR is still necessary, create a new one with the same branch. Thank you.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Oct 22, 2024
@KATT
KATT deleted the subscription-connection-state branch November 1, 2024 11:24

This branch had an error being deployed

3 failed and 2 active deployments
Preview – www β€” 904f12b1 Deployed Aug 2, 2024 by vercel[bot]
Preview – examples-todomvc β€” 904f12b1 Deployed Aug 2, 2024 by vercel[bot]
Preview – trpc-next-app-dir β€” 904f12b1 Deployed Aug 2, 2024 by vercel[bot]
Preview – next-prisma-starter β€” 904f12b1 Deployed Aug 2, 2024 by vercel[bot]
Preview – og-image β€” 904f12b1 Deployed Aug 2, 2024 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: access subscription connection status from tRPC client feat: Make useSubscription return info about the subscription

3 participants