
Frontend @spotdrafthq, experienced in both react and angular.
Bengaluru
Joined November 2022
- Tweets55
- Following117
- Followers15
- Likes92
Ayush Seth retweeted
Replying to @thdxr
I think you should be able to articulate a meaningful way your solution could be better than an alternative before going too deep on a project
Ayush Seth retweeted
Replying to @Julien_Delort
you can do that in the global handler, too. It has access to `data` from the query, and the whole query itself, so the `meta` field is pretty powerful here:
teapawt.net/TkDodo/status/16474930…
Replying to @songil
you can use your useVouchers() hook multiple times, in different components though ?
One trick is to set the `meta` field to contain the message that you want, and let the global handler pick that up:
![const queryClient = new QueryClient({ queryCache: new QueryCache({ onSuccess: (data, query) => { if (query.meta.message) { showSuccessToast(query.meta.message) } } }) }) export function useVouchers() { return useQuery({ queryKey: ['vouchers'], queryFn: fetchVouchers, meta: { message: 'Successfully fetched vouchers', }, }); }](https://pbs.twimg.com/media/Ft0R-nIWAAEbPUK.jpg?name=small&format=webp)
ALT const queryClient = new QueryClient({ queryCache: new QueryCache({ onSuccess: (data, query) => { if (query.meta.message) { showSuccessToast(query.meta.message) } } }) }) export function useVouchers() { return useQuery({ queryKey: ['vouchers'], queryFn: fetchVouchers, meta: { message: 'Successfully fetched vouchers', }, }); }
Ayush Seth retweeted
80% programmers use VS Code.
But their Productivity Suck.
Here are the top 8 VS code extensions to take your productivity to next level.
A Thread🧵👇
Ayush Seth retweeted
i think neovim builtin lsp + mason.nvim (if you want auto install) is pretty seamless experience. you could checkout github.com/nvim-lua/kickstar… as an example starter config that sets a bunch of this up
Ayush Seth retweeted
"sure an n^2 solution works, but can you come up with something a little faster?"














