正在加载视频...

视频加载失败

❌ Avoid multiple state variables to track status. ✅ Instead use enums.

152,349 次观看 • 1 年前 •via X (Twitter)

8 条评论

statuscast 的头像
statuscast2 年前

Help your IT team cut through 'Are you down?' clutter with StatusCast’s Audience Specific Status Pages. Tailor your status page to each user's role and needs for effective incident communication.

Roushou (e/acc) 的头像
Roushou (e/acc)1 年前

Even better to use a union string

FullStackIzzy 的头像
FullStackIzzy1 年前

George, I definitely need to try your implementation. Because this can't be life. I apologize for my code below🤦‍♂️:

Marcelo Terreiro 的头像
Marcelo Terreiro1 年前

Holy crap don’t do this. Why enums if you can you a string literal lol

Alexandru Corut 的头像
Alexandru Corut1 年前

Nice, but what’s the error.message?

Pavel Romanov 的头像
Pavel Romanov1 年前

If it is only possible to have one of the states at a time, then it is a way to go 👌 It's also much easier to work with a single state than with all those boolean logic conditions mixed into the component.

Alessandro 的头像
Alessandro1 年前

It's not enum

Dika 的头像
Dika1 年前

It only records status, how do you save the value of error message?

相关视频