TypeScript is Literal Magic

TypeScript is Literal Magic

Fireship

3 года назад

885,473 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@kuroitsuki4076
@kuroitsuki4076 - 28.04.2022 06:47

I love ts

Ответить
@rohanmanchanda5250
@rohanmanchanda5250 - 29.04.2022 05:56

No

Ответить
@killerwhiteshark1797
@killerwhiteshark1797 - 08.05.2022 20:37

How do I save this

Ответить
@v0id_d3m0n
@v0id_d3m0n - 16.05.2022 14:52

That looks very cool

Ответить
@Bratjuuc
@Bratjuuc - 17.05.2022 11:23

Wow, almost looks like an algebraic data type. I have never seen anything like that, yet I see that again

Ответить
@alifaisal1475
@alifaisal1475 - 17.05.2022 20:21

Are these equivalent to c# enums?

Ответить
@PTM1008
@PTM1008 - 18.05.2022 17:53

How to derive an array of these 25 types. Or do I need to do it the hard way?

Ответить
@illegalsmirf
@illegalsmirf - 20.05.2022 01:26

Didn’t understand any of this, thanks

Ответить
@___jd
@___jd - 23.05.2022 04:52

TypeScript is actually unnecessary trash bloat tho, change my mind ¯\_(ツ)_/¯

Ответить
@sagitswag1785
@sagitswag1785 - 23.05.2022 08:24

Wait till typescript devs learn what a struct is

Ответить
@HarrysKavan
@HarrysKavan - 23.05.2022 14:00

Could you do a video about types and interfaces. And when to use what. The seem to partially be redundant.

Ответить
@bigblackbadger1
@bigblackbadger1 - 25.05.2022 01:03

I don’t understand this sorry

Ответить
@Dr_Ainz
@Dr_Ainz - 26.05.2022 04:27

Nice, now I can make my code completely incomprehensible and ensure my continued employment. After all, no one they hire will be able to decipher the ultra-nested hell I use this feature to create in my codebase.

Ответить
@WhiteKnuckleRide512
@WhiteKnuckleRide512 - 26.05.2022 08:20

What the fuck is a type

Ответить
@trollerjakthetrollinggod-e7761
@trollerjakthetrollinggod-e7761 - 26.05.2022 19:31

So this is C++ Enum with emojis?

Ответить
@NyscanRohid
@NyscanRohid - 28.05.2022 00:25

You can't have a language called "TypeScript" without it involving a little type theory.

Ответить
@supercellodude
@supercellodude - 28.05.2022 00:28

Instead of arrogantly bragging about Template Haskell, I'm going to try implementing a similar process to what was shown to determine ease or difficulty

Ответить
@jamesdials13
@jamesdials13 - 28.05.2022 15:54

Those are like inline enums

Ответить
@qvcitizen
@qvcitizen - 30.05.2022 11:20

Meanwhile in JS u don’t even need to worry about types, but thanks.

Ответить
@riflan0ahmed
@riflan0ahmed - 01.06.2022 17:53

How are you adding emoji?

Ответить
@nagulanngl991
@nagulanngl991 - 02.06.2022 12:00

😳👍👍

Ответить
@DailyDoseOfCCP
@DailyDoseOfCCP - 02.06.2022 13:18

Really useful 🤠

Ответить
@Meleeman011
@Meleeman011 - 02.06.2022 21:44

Why not just use an array?

Ответить
@gggiiia147
@gggiiia147 - 03.06.2022 12:24

JS the world

Ответить
@agentgrim5687
@agentgrim5687 - 03.06.2022 17:58

I lost my last braincell trying to be a programmer now i dont know what 1 + 1 in math anymore

Ответить
@sorvex9
@sorvex9 - 08.06.2022 01:12

Jesus JavaScript Is such a mess

Ответить
@priceyindividual2995
@priceyindividual2995 - 11.06.2022 08:46

This might be the most glorious thing I’ve witnessed all week

Ответить
@Lord_Omni
@Lord_Omni - 17.06.2022 00:03

So... they have limited your ability to use whatever whenever, but then have added a way around it? I've will never understand why TypeScript exists.

Ответить
@hexadecimalhexadecimal5241
@hexadecimalhexadecimal5241 - 17.06.2022 05:36

Literally magic.

Ответить
@pixobit5882
@pixobit5882 - 03.09.2022 04:49

I'm creating a card game with different colors and values. This literally saves my life. 7 Lines of code result in 105 unique cards.

Ответить
@tipfertilizer4595
@tipfertilizer4595 - 07.09.2022 18:20

You always make confused explaination

Ответить
@baka_baca
@baka_baca - 11.09.2022 07:35

Wow... Now that is a lovely type system! Gets me more interested in picking up Typescript for sure!

Ответить
@alliscool4009
@alliscool4009 - 25.09.2022 09:50

SO MAGICAL 🤩

Ответить
@catthe5359
@catthe5359 - 25.10.2022 18:25

cool

Ответить
@adrianseidel4467
@adrianseidel4467 - 14.12.2022 19:47

I dont really like the way they implemented template types.
It's not possible to make a hex color type (`#${"a" | "b" | ... | "z" | "A" | ... | "Z" | 0 | ... | 9}`), because it would be to many possible combinations. They either could have just checked, if the input matches the template instead of generating and saving every possible combination and so limitating the range of possiblities, or, what would be even better, implemented regex based template types.

Something that I also miss in ts, are conditional Interface fields.
To always use
type T = {
a: true;
b: number;
} | {
a: false;
}
really sucks.
I would really like something like this.
interface I {
a: boolean;
b[a]: number;
}

Ответить
@horrid13
@horrid13 - 06.02.2023 02:26

👏👏👏👏

Ответить
@WREFMAN
@WREFMAN - 08.02.2023 03:31

Why?

Ответить
@mustafayasser120
@mustafayasser120 - 08.02.2023 21:54

Wooooo

Ответить
@mralex6543
@mralex6543 - 09.04.2023 00:39

There was only one time I really applied this feature, love typescript

Ответить
@trio9355
@trio9355 - 05.05.2023 22:21

Useless

Ответить
@bowiemtl
@bowiemtl - 11.06.2023 01:04

Imagine if this existed in css, lot of libraries would see their last days

Ответить
@TheOPtmal
@TheOPtmal - 21.06.2023 19:53

ClojureScript still wins

Ответить
@sagarjain9203
@sagarjain9203 - 28.06.2023 11:10

How to get all these items in dropdown liat

Ответить
@commandcracker8635
@commandcracker8635 - 30.06.2023 18:09

That’s actually insanely cool

Ответить
@AvenDonn
@AvenDonn - 04.08.2023 10:43

Reinvented the class

Ответить
@thatsenoughdixit
@thatsenoughdixit - 12.09.2023 09:53

Love love love it ❤

Ответить
@Eliecerhdz
@Eliecerhdz - 16.11.2023 01:36

If they keep doing this Typescript wont die for sure.

Ответить
@c0zn1c
@c0zn1c - 01.12.2023 02:13

What practical benefits would this have? Trying to point to a single variable using multiple formulas or something? I'm new at coding, please be kind 😢. Interdependent yet independent?

Anyone use this in real world scenarios?

Ответить
@Naniirowadesuka
@Naniirowadesuka - 16.12.2023 18:05

groaning noises

Ответить