feat(client): add React hooks — createCorsairReactClient()#263
Open
yuvrxj-afk wants to merge 4 commits into
Open
feat(client): add React hooks — createCorsairReactClient()#263yuvrxj-afk wants to merge 4 commits into
createCorsairReactClient()#263yuvrxj-afk wants to merge 4 commits into
Conversation
Contributor
|
@yuvrxj-afk is attempting to deploy a commit to the corsair Team on Vercel. A member of the Team first needs to authorize it. |
3 tasks
Contributor
Greptile SummaryReview completed and submitted via the Greptile review tools. Confidence Score: 5/5Safe to merge — core hooks are correct, race condition addressed, all tests pass. No blocking issues found. Remaining items are non-blocking cleanup. packages/corsair/client/react/index.ts Reviews (4): Last reviewed commit: "fix(test): wire setup-jsdom-fetch.cjs in..." | Re-trigger Greptile |
05c7a4a to
d60bf30
Compare
Contributor
Author
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #250 — diff will clean up once that lands.
Summary
createCorsairReactClient({ baseURL })— factory returning typed React hooks over the vanillacreateCorsairClient.useTenants,useTenant,useCreateTenant,usePlugins,usePlugin,useConnectionStatus,usePermission,usePermissionByToken,useCreateConnectLink,useOAuthCallback, plus the underlyingclientas an escape hatch.useAsync(fn, deps)for reads (idle → loading → success | error, withrefetch) anduseMutation(fn)for writes (stays idle untilmutate(input)).Notes
>=18), not a hard dep. Vanilla client still works without React.tests/setup-jsdom-fetch.cjspolyfillsfetchunder jsdom).mainonce feat(core): add connect and OAuth callback routes #250 and this merge.Test plan
management-react-client.test.ts— loading/error/success states,refetch, re-fetch on dep change, mutation lifecycle