Skip to content

Conversation

@Addonay
Copy link

@Addonay Addonay commented Oct 13, 2025

Overview

This PR introduces two new convenience hooks for the convex-svelte library: useMutation and useAction.

Changes

  • Added useMutation hook for easier mutation handling
  • Added useAction hook for easier action handling
  • Moved Convex files to src/lib/convex/ for better organization
  • Added unit tests for the new hooks
  • Added e2e tests to verify functionality
  • Refactored components for improved reusability

Backward Compatibility

There are no breaking changes. Users can continue to use client.mutation() if they prefer. These new hooks provide a more convenient alternative API.

Testing

Unit tests and e2e tests have been added to verify the new hooks work correctly. Run npm test to verify.

Additional Notes

  • Switched to Bun for dependency management (added bun.lock)
  • Updated package.json exports configuration
  • Updated dependencies to use more later versions.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@vercel
Copy link

vercel bot commented Oct 13, 2025

@Addonay is attempting to deploy a commit to the Convex Team on Vercel.

A member of the Team first needs to authorize it.

@CL-Jeremy
Copy link

I think this looks quite concise and would suit my use case pretty well, but am unsure if this could be merged as-is. Maybe someone with more insights on the Convex browser client API could step in and provide some feedback.

I'd also link this closed issue (#23) as the author also attempted to implement useMutation and the discussion mentioned an aspect of the API not touched on in this implementation.

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