Daniel Fry (@danfrydev) 's Twitter Profile
Daniel Fry

@danfrydev

Software Engineer @chase_uk

ID: 1497018293772767237

linkhttps://danfry.dev calendar_today25-02-2022 01:19:22

62 Tweet

355 Followers

1,1K Following

George Moller (@_georgemoller) 's Twitter Profile Photo

❌ Avoid difficult-to-read conditionals to render elements in react. ✅ Instead use utility components for conditional rendering.

Wes Bos (@wesbos) 's Twitter Profile Photo

🔥 JavaScript Sets are about to become a lot more useful with these 7 new methods: .difference() .intersection() .symmetricDifference() .union() .isSubsetOf() .isSupersetOf() .isDisjointFrom()

🔥 JavaScript Sets are about to become a lot more useful with these 7 new methods:

.difference()
.intersection()
.symmetricDifference()
.union()
.isSubsetOf()
.isSupersetOf()
.isDisjointFrom()
Dominik 🔮 (@tkdodo) 's Twitter Profile Photo

📢Announcing TanStack Query v5 🎉🥳 🤝 unified object API 📈 simplified, optimistic updates ♻️ sharable mutation state 🔀 suspense and streaming w/ RSC ♾️improved infinite queries ⚡️ ~20 % smaller 🛠️new agnostic devtools 💾 fine-grained persistence

Matt Pocock (@mattpocockuk) 's Twitter Profile Photo

TypeScript 5.4 will bring a new utility type: NoInfer. This will be EXTREMELY useful for generic functions where you have multiple candidates for inferring a type. In the example below, we use NoInfer to make sure that 'initial' must be one of the states passed.

TypeScript 5.4 will bring a new utility type: NoInfer.

This will be EXTREMELY useful for generic functions where you have multiple candidates for inferring a type.

In the example below, we use NoInfer to make sure that 'initial' must be one of the states passed.
Dominik 🔮 (@tkdodo) 's Twitter Profile Photo

📚 So I finally found the time to write about why we made the breaking parameter changes in v5, and what this new API enables us to do. Prepare to have your mind blown if you don't yet know what the Query Options API can do for you 🤯 tkdodo.eu/blog/the-query…

Raycast (@raycastapp) 's Twitter Profile Photo

The Mac turns 40 today 🎂 To celebrate, we're giving away Raycast Pro with GPT-4 for one year to 40 people. Simply retweet this tweet and follow Raycast to enter. Winners will be announced by the end of the week.

The Mac turns 40 today 🎂

To celebrate, we're giving away Raycast Pro with GPT-4 for one year to 40 people. Simply retweet this tweet and follow <a href="/raycastapp/">Raycast</a> to enter. Winners will be announced by the end of the week.
Gabriel Vergnaud (@gabrielvergnaud) 's Twitter Profile Photo

TypeScript v5.5 is going to be soooo amazing 🔥 The type-checker will now be able to *infer* type predicates for us 😍 And there's more. Type predicates will ✨compose✨! Huge, huge thanks to Dan Vanderkam 🦋 for landing this PR, I'm so excited about this!

TypeScript v5.5 is going to be soooo amazing 🔥

The type-checker will now be able to *infer* type predicates for us 😍

And there's more. Type predicates will ✨compose✨!

Huge, huge thanks to <a href="/danvdk/">Dan Vanderkam 🦋</a> for landing this PR, I'm so excited about this!
Cory House (@housecor) 's Twitter Profile Photo

TypeScript problem: You need to support any string value, but you’d like autocomplete support for common values. Solution: Create a union with "string & {}" on the end. Now you get autocomplete support for all values listed in the union, but can still enter any value.

TypeScript problem: You need to support any string value, but you’d like autocomplete support for common values. 

Solution: Create a union with "string &amp; {}" on the end.

Now you get autocomplete support for all values listed in the union, but can still enter any value.
colinhacks/zod (@colinhacks) 's Twitter Profile Photo

loving this pattern to avoid redundancy in complex class declarations...extract the props from the class prototype and use it as the constructor argument ✅ typesafe ✅ no redundant interfaces ✅ constructor becomes a one-liner

loving this pattern to avoid redundancy in complex class declarations...extract the props from the class prototype and use it as the constructor argument

✅ typesafe
✅ no redundant interfaces
✅ constructor becomes a one-liner
Matt Pocock (@mattpocockuk) 's Twitter Profile Photo

Here's my favourite method for getting Go/Zig/Rust-like errors in TS. It's by returning custom errors from functions. - Shows right in the return type - Easy checking with instanceof - No deps required

Here's my favourite method for getting Go/Zig/Rust-like errors in TS.

It's by returning custom errors from functions.

- Shows right in the return type
- Easy checking with instanceof
- No deps required
Cory House (@housecor) 's Twitter Profile Photo

Goal: Calculate a value once per render. Mistake: Declaring a parameterless function. Why? Because then the function may be needlessly called multiple times on every render. Solution: If a function takes no args, declare a variable instead.