Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

Problem: I want to ensure my switch statement handles all potential cases. Solution: Use TypeScript's never type. Here's how:

49,603 görüntüleme • 1 yıl önce •via X (Twitter)

11 Yorum

Cory House profil fotoğrafı
Cory House1 yıl önce

Full course with code for 20% off:

Alexander Mia profil fotoğrafı
Alexander Mia1 yıl önce

INTRODUCING: Agentic Security - LLM Security Scanner! 🔍 🔑 Features: Scans for prompt injections, jailbreaking & more. Provides detailed reports & options to customize attack rules. 🔗access the GitHub Link ↓

Pavel Svitek 🇨🇭 profil fotoğrafı
Pavel Svitek 🇨🇭1 yıl önce

Great tip.. this is a really good lib to handle these kind of issues

Cory House profil fotoğrafı
Cory House1 yıl önce

Feel unnecessary to me, but I can see how one might prefer it

Artem Zakharchenko profil fotoğrafı
Artem Zakharchenko1 yıl önce

This is awesome!

Wildan profil fotoğrafı
Wildan1 yıl önce

nice use of never. learned a new thing!

ً profil fotoğrafı
ً1 yıl önce

should just do `pet satisfies never`

tom byrer profil fotoğrafı
tom byrer1 yıl önce

Or, if you have nested switch/if statements inside of your switch, use a Finite State Machine ;)

BDR profil fotoğrafı
BDR1 yıl önce

Great tip thanks!

Benjamin Scott profil fotoğrafı
Benjamin Scott1 yıl önce

Ah so that’s why “never” pops up every now and then To be honest, I’ve always hated seeing it but never understood it until recently

Niko E. profil fotoğrafı
Niko E.1 yıl önce

A realy good one.

Benzer Videolar