-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat(client
): add ability to call TRPCProxyClient
-methods with .apply()
#3973
Conversation
β¦function method
The latest updates on your projects. Learn more about Vercel for Git βοΈ
|
@atoy40 is attempting to deploy a commit to the trpc Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why you need this, but if you do, please add tests
@KATT I dont' need it directly. I need it because i'm using redux-saga, a tools over redux which help to handle/synchronize async operation and state managment using JS function generators. This library provide helpers to handle promises, one of them is Btw, I'll add a test. Anthony. |
Cool, I'm happy to merge if there are some tests that asserts it |
TRPCProxyClient
methods with .apply()
TRPCProxyClient
methods with .apply()
TRPCProxyClient
-methods with .apply()
@KATT I added a test, I hope It's located well. |
should we handle |
bumping this, @atoy40 would you be willing to update this PR with @bautistaaa's feedback? |
TRPCProxyClient
-methods with .apply()
client
): add ability to call TRPCProxyClient
-methods with .apply()
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@trpc/client](https://trpc.io) ([source](https://togithub.com/trpc/trpc)) | [`10.27.1` -> `10.28.0`](https://renovatebot.com/diffs/npm/@trpc%2fclient/10.27.1/10.28.0) | [![age](https://badges.renovateapi.com/packages/npm/@trpc%2fclient/10.28.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@trpc%2fclient/10.28.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@trpc%2fclient/10.28.0/compatibility-slim/10.27.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@trpc%2fclient/10.28.0/confidence-slim/10.27.1)](https://docs.renovatebot.com/merge-confidence/) | | [@trpc/react-query](https://trpc.io) ([source](https://togithub.com/trpc/trpc)) | [`10.27.1` -> `10.28.0`](https://renovatebot.com/diffs/npm/@trpc%2freact-query/10.27.1/10.28.0) | [![age](https://badges.renovateapi.com/packages/npm/@trpc%2freact-query/10.28.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@trpc%2freact-query/10.28.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@trpc%2freact-query/10.28.0/compatibility-slim/10.27.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@trpc%2freact-query/10.28.0/confidence-slim/10.27.1)](https://docs.renovatebot.com/merge-confidence/) | | [@trpc/server](https://trpc.io) ([source](https://togithub.com/trpc/trpc)) | [`10.27.1` -> `10.28.0`](https://renovatebot.com/diffs/npm/@trpc%2fserver/10.27.1/10.28.0) | [![age](https://badges.renovateapi.com/packages/npm/@trpc%2fserver/10.28.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@trpc%2fserver/10.28.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@trpc%2fserver/10.28.0/compatibility-slim/10.27.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@trpc%2fserver/10.28.0/confidence-slim/10.27.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>trpc/trpc</summary> ### [`v10.28.0`](https://togithub.com/trpc/trpc/releases/tag/v10.28.0) [Compare Source](https://togithub.com/trpc/trpc/compare/v10.27.3...v10.28.0) #### What's Changed - feat(`client`): allow closing active subscriptions by [@​Dealerpriest](https://togithub.com/Dealerpriest) in [trpc/trpc#4136 - feat(`client`): add ability to call `TRPCProxyClient`-methods with `.apply()` by [@​atoy40](https://togithub.com/atoy40) in [trpc/trpc#3973 - feat(`react-query`): allow optional cursor in `useInfiniteQuery` by [@​lithdew](https://togithub.com/lithdew) in [trpc/trpc#4374 - fix(`*`): exclude `*.test.*`-files in build outputs by [@​KATT](https://togithub.com/KATT) in [trpc/trpc#4417 #### New Contributors - [@​atoy40](https://togithub.com/atoy40) made their first contribution in [trpc/trpc#3973 - [@​miguelvelasquezdev](https://togithub.com/miguelvelasquezdev) made their first contribution in [trpc/trpc#4341 - [@​lithdew](https://togithub.com/lithdew) made their first contribution in [trpc/trpc#4374 **Full Changelog**: trpc/trpc@v10.27.3...v10.28.0 ### [`v10.27.3`](https://togithub.com/trpc/trpc/releases/tag/v10.27.3) [Compare Source](https://togithub.com/trpc/trpc/compare/v10.27.2...v10.27.3) #### What's Changed - fix(`react-query`): fix `useInfiniteQuery` `placeholderData` types by [@​SSHari](https://togithub.com/SSHari) in [trpc/trpc#4402 #### New Contributors - [@​SSHari](https://togithub.com/SSHari) made their first contribution in [trpc/trpc#4402 **Full Changelog**: trpc/trpc@v10.27.2...v10.27.3 ### [`v10.27.2`](https://togithub.com/trpc/trpc/releases/tag/v10.27.2) [Compare Source](https://togithub.com/trpc/trpc/compare/v10.27.1...v10.27.2) #### What's Changed - fix(`next)`: remove conditional hook in `withTRPC()` by [@​KATT](https://togithub.com/KATT) in [trpc/trpc#4410 **Full Changelog**: trpc/trpc@v10.27.1...v10.27.2 </details> --- ### Configuration π **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). π¦ **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. π **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/synopsisgg/bot). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMDIuNCIsInVwZGF0ZWRJblZlciI6IjM1LjEwMi40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
Closes #3964
π― Changes
This PR allow the client to be call as :
client.myrouter.myresolver.query.apply(undefined, [input])
instead of :
client.myrouter.myresolver.query(input)
It allows to use tools where you pass the function, and the tool call it using apply on the function object itself.
β Checklist