Skip to content

chore: update .connect to .mutate #4686

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

o-az
Copy link
Contributor

@o-az o-az commented May 26, 2025

useConnect():

  • deprecate .connect and .connectAsync,
  • add .mutate and .mutateAsync,
  • updates tests to use mutate,
  • update connect to mutate in docs for Vue and React

useDisconnect():

  • deprecate .disconnect and .disconnectAsync,
  • add .mutate and .mutateAsync,
  • updates tests to use mutate,
    • update disconnect to mutate in docs for Vue and React

Copy link

changeset-bot bot commented May 26, 2025

⚠️ No Changeset found

Latest commit: 05e353c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented May 26, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
wagmi ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 26, 2025 6:34am

Copy link
Member

@tmm tmm left a comment

Choose a reason for hiding this comment

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

Nice! Ideally we could extend this in the following ways:

  • Remove 'mutate' | 'mutateAsync' from being omitted from the query return type (React, Vue)
  • Add @deprecated comments to the XMutate and XMutateAsync type helpers (e.g. ConnectMutate and ConnectMutateAsync)
  • Add mutate/mutateAsync for all mutation hooks (along with the above and @deprecated comments for named return methods)

You are welcome to work on this or I can merge you PR into another branch and do this when I get some time.

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.

2 participants