Hello everyone, this article is a summary of my learning TypeScript. The current version only writes about the basic use of typeScript, modules, namespaces, modifiers, etc. when summarizing, I always feel that the case is a little pale. I will summarize and output it in the following ts project demo.I study by watching teaching videos ...
Posted on Mon, 29 Nov 2021 14:23:13 -0500 by DoctorWho
1, Advanced type
& cross type
Cross type is to combine multiple types into one type. This allows us to stack existing types together into one type, which contains all the required types of features.
Syntax: T & U
Its return type must comply with T The type shall also comply with U type
Posted on Wed, 24 Nov 2021 06:40:10 -0500 by john6384
Note: this blog does not talk about the principle. If you don't understand it, please supplement the relevant contents such as policy mode, state mode, closure, lazy evaluation, functional programming, etc
2, Why use policy and state patterns
vue ordinary tab switching is very simple. You can do it with the following code. I'm af ...
Posted on Sun, 07 Nov 2021 17:04:48 -0500 by reecec
This interface is not the other interface. In ts, it is only a kind of object, which is used to define the type of object
What is an interface
In object-oriented language, Interfaces is a very important concept. It is the abstraction of behavior, and how to act needs to be implement ed by classes.
ts interface interfaces are ...
Posted on Thu, 28 Oct 2021 07:02:28 -0400 by chrispols
Covariance and inversion in typescript
If we want to write better type programming, we must master the knowledge of CO variance and contra variance. This record is only for the convenience of quickly locating the problems in writing code according to this article when there are problems in the application of this knowledge in the future. Th ...
Posted on Tue, 21 Sep 2021 01:59:21 -0400 by viv