Opens profile photo
Follow
Click to Follow alexdotjs
Alex / KATT ๐Ÿฑ
@alexdotjs
๐Ÿ‘‹ I'm Alex & I tweet about web dev stuff. ๐Ÿ‘‰ Creator of (โญ๏ธ25k+). ๐Ÿง™โ€โ™‚๏ธ Open-sourcerer & fully-stacked typescripter. ๐Ÿ—ฃ Speak ๐Ÿ‡ธ๐Ÿ‡ช๐Ÿด๓ ง๓ ข๓ ฅ๓ ฎ๓ ง๓ ฟ๐Ÿ‡ง๐Ÿ‡ท
Malmรถ, Swedengithub.com/KATTBorn December 7, 1988Joined July 2010

Alex / KATT ๐Ÿฑโ€™s Tweets

Great idea, rewrite a full working product that works well and is making millions in a technology wherein few, if any, in the team has strong expertise because it's sexier(?)
4
33
Show this thread
Talked to a friend the other day who works at a company where some tech leads are lobbying that the solution to their recruiting problems is to migrate their whole tech stack from Vue to React ๐Ÿคฆโ€โ™‚๏ธ
Quote Tweet
What happened to the "choose boring tech" movement?
Show this thread
18
118
Show this thread
๐Ÿ’ฏ
Quote Tweet
if I was doing coding interviews I would let the candidate do literally whatever the fck they wanted to do to get the answer, as long as the code runs and they have somewhat of a grasp of how it works google, stack overflow, chatgpt, github, name it if someone is fast, correct,โ€ฆย Show more
Show this thread
16
โ™ฅ
Quote Tweet
Y'all are missing a huge, well deserved nominee for github stars and that's @alexdotjs. Just saying @trpcio revolutionised an aspect of web dev and it made our lives easier, and this guy is a factor why I landed my first job, his impact on our community can't be understated โค๏ธ
Image
26
My #1 fav thing about serverless tho is that my shitty code won't crash the app for many users by am uncaught exception or memory leaks. So I guess what I really want is Apache for node
1
Show this thread
In case you didn't know, you get batching automatically with trpc ๐Ÿ™ƒ
Quote Tweet
๐ŸคฏI still like this demo shown here a lot: combining React Query with dataloader. If you have an API that can batch requests, but you still want to treat them as separate "detail-query" resources, this is for you: github.com/TanStack/query
Show this thread
1
43
Congrats and all contributors for making it into the first cohort of the GitHub Accelerator. Well deserved ๐Ÿš€๐ŸŽ‰
Quote Tweet
Announcing the inaugural cohort of the GitHub Accelerator: 20 projects embarking on a 10-week journey to build a sustainable funding model. github.blog/2023-04-12-git
Image of Mona in an astronaut suit in space.
80
Alternatively, use tRPC and never think about query keys again
Quote Tweet
Problem: With react-query, we may declare inconsistent query keys. That leads to cache misses and duplicated cache entries. ๐Ÿ‘Ž Solution: 1. Wrap each useQuery call in a custom hook. Store the hooks in /hooks. 2. Put the fetch call in the custom hook. *Donโ€™t export it*. 3.โ€ฆย Show more
Show this thread
// useProductQuery.js
import { useQuery } from "@tanstack/react-query";

// This fetch is deliberately NOT exported.
// This assures the hook below is the only way to fetch. 
async function getProduct(productId) {
  const resp = await fetch('/products/' + productId);
  if (!resp.ok) throw new Error("Failed fetch");
  return resp.json();
}

// Wrapping call to useQuery in custom hook
// This assures the query key is consistent
// This also avoids repeating boilerplate config.
export function useGetProduct(productId) {
  return useQuery({
    queryKey: ["products", productId],
    queryFn: () => getProducts(productId),
  });
}
8
187