Abhishek Khurana (@_a6hi) header
Abhishek Khurana (@_a6hi) profile picture

$(''me .bio'').say(''Mediocre Arrogant'');

Joined November 2008
Photo by Abhishek Khurana (@_a6hi)Photo by Abhishek Khurana (@_a6hi)Photo by Abhishek Khurana (@_a6hi)Photo by Abhishek Khurana (@_a6hi)Photo by Abhishek Khurana (@_a6hi)Photo by Abhishek Khurana (@_a6hi)Photo by Abhishek Khurana (@_a6hi)Photo by Abhishek Khurana (@_a6hi)Photo by Abhishek Khurana (@_a6hi)
If you live with a problem long enough, the solution will automatically come.
84
Turn a page, a new chapter beckons!
5
152
Abhishek Khurana retweeted
📚 Automatic Query Invalidation after Mutations isn't a thing in React Query - but did you know that it takes just a couple of lines of code to build this in user-land? New blog-post is up now 🎉
10
27
2
346
38,933
Abhishek Khurana retweeted
Problem: You want to initialize something only once in a React component. Solution: Call useState without a setter. Idea via @TkDodo
38
61
13
746
189,948
IPL 2024: Playoffs and Finals are yet to come, but i guess we have already witnessed the best match (#68) of the season. #RCBvsCSK #iplt20
187
#NoteToSelf "If you want to learn something, read about it. If you want to understand something, write about it. If you want to master something, teach it.”
70
“The reason why you want it so badly right now is because you already have it in the future.” [sic]
6
289
Abhishek Khurana retweeted
had never heard of AbortSignal.timeout, lets build a handy abstraction over it!
Just found out that Fetch API has built-in timeout support! 🤯
16
75
6
631
76,364
Abhishek Khurana retweeted
Workout cheat codes I know at 44 that I wish I knew at 24:
68
1,003
33
8,752
2,982,237
A preacher converts. An inquisitor sees to it that the flock stay faithful.
1
117
Abhishek Khurana retweeted
Use Zod to parse your environment variables once, then use that inference to type process.env throughout your app. Also, a beautiful example of how you can extend an interface from a VALUE, not a type.
58
192
14
2,136
204,000
> Hey, TARS, what's your honesty parameter? >> 'Ninety Percent.' > Ninety Percent? >> Absolute honesty isn't always the most diplomatic nor the safest form of 'communication with emotional beings.' #Interstellar
2
118
Abhishek Khurana retweeted
Problem: Cache invalidation is hard. Example: One of my clients uses React Query heavily. We have 100's of query keys, and many are quite complex. When a mutation occurs, we often need to invalidate multiple related queries. So, it's easy to forget to invalidate related queries when a mutation occurs. Solution: Colocate related queries in the same file and centralize keys at the top. This helps us reuse keys, and helps us find related queries when writing a new mutation. (Example below) Anyone else have tips in this area? cc @TkDodo
58
80
9
986
165,669
Abhishek Khurana retweeted
Use instrumentation.ts to run code at startup in Next.js 14
6
26
2
328
48,640
Abhishek Khurana retweeted
I often group related props into an object. Advantages: ✅ Less code, so easier to read ✅ Clarifies the relationship between related fields ✅ Makes it easier to pass the data around ✅ Don’t need to change the component’s API when properties change
46
32
4
553
143,046
Abhishek Khurana retweeted
• Read everyday. • Spend time with nature. • Ask questions. • Never stop learning. • Don't pay attention to what others think of you. • Do what interests you the most. • Study hard. • Teach others what you know. • Make mistakes and learn. • It's Okay to not know things!
69
2,233
70
8,262
525,085