Рет қаралды 127
ducin.dev, #typescript playground: tsplay.dev/NBdMVW
Whenever creating reusable functions, components - or even a internally shared library - you might want to make IDE's intellisense (powered by TypeScript, of course) to suggest some predefined values. There are lots of dark magic tricks in #TypeScript - and here we'll learn one of them.
00:08 intro
00:49 replace the ordinary string with an equivalent
01:37 string is not swallowed by Object type
01:53 make the union with the extraordinary string