Video yükleniyor...
Video Yüklenemedi
In TypeScript, there are at least 4 ways to implement immutability. Here's how I choose between them.
13,590 görüntüleme • 1 yıl önce •via X (Twitter)
10 Yorum

Very well explained, Cory!

Question: At what point in the development cycle do you begin to worry about immutability? For solo or very small teams focused on deploying asap should this be a priority?

Fully-typed and fully-tested deepFreeze:

we need a 5th way

I’m likely forgetting at least two

@ezdubs_bot english to japanese

Only in JavaScript, we declare something as const but then add an `as const` at the end of it to say, please remain immutable.

So how would you choose between the typescript versions? Mainly when to use `as const` vs `readonly/ReadOnly`

readonly is the only granular option. Otherwise I generally prefer “as const”

Full course with a 20% discount:
Benzer Videolar
There are only 4 ways to get rich....
Empire Mindset | Wealth Architect
70,404 görüntüleme • 7 ay önce


