Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

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

49,603 Aufrufe • vor 1 Jahr •via X (Twitter)

11 Kommentare

Profilbild von Cory House
Cory Housevor 1 Jahr

Full course with code for 20% off:

Profilbild von Alexander Mia
Alexander Miavor 1 Jahr

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 ↓

Profilbild von Pavel Svitek 🇨🇭
Pavel Svitek 🇨🇭vor 1 Jahr

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

Profilbild von Cory House
Cory Housevor 1 Jahr

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

Profilbild von Artem Zakharchenko
Artem Zakharchenkovor 1 Jahr

This is awesome!

Profilbild von Wildan
Wildanvor 1 Jahr

nice use of never. learned a new thing!

Profilbild von ً
ًvor 1 Jahr

should just do `pet satisfies never`

Profilbild von tom byrer
tom byrervor 1 Jahr

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

Profilbild von BDR
BDRvor 1 Jahr

Great tip thanks!

Profilbild von Benjamin Scott
Benjamin Scottvor 1 Jahr

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

Profilbild von Niko E.
Niko E.vor 1 Jahr

A realy good one.

Ähnliche Videos