正在加载视频...
视频加载失败
⚛️ How to use discriminated unions in TypeScript to represent mutually exclusive states in React↓
28,192 次观看 • 1 年前 •via X (Twitter)
9 条评论

I've been working professionally with React for more than 8 years and I compiled all my knowledge into 100+ infographics and 77 video tutorials just like this one. Check them out ↓

This is the best way to represent loading data and the one I use. Unfortunately I often see this representation type Response<T, E> = { isPending: Boolean, error: T | null, data: T} which can represent invalid states

Glad you liked it :)

This is nice!

Really like your new video style! Can you point out a good Typescript course?

I have another one, its called “react-query”

shouldn't be better an enum or even better an obj as const? instead of work with literal strings?

@_georgemoller thanks for sharing it! Just wondering what tool do you use to record the videos? They are really good 👍

How did your create this animation?
