React Hooks Deep Series - Design Mode
This article is React Hooks in-depth series Follow-up.This article details the advantages of Hooks over classes, introduces the design ideas of related api, and explains how Hooks align the life cycle hooks of classes.
React Logo and Hooks
React's logo is an atomic pattern in which atoms make up the representation of matter.Similarly, React is ...
Posted by Unknown_Striker on Wed, 31 Jul 2019 14:44:19 -0700
Implementation of dependency injection for type cript node JS
Dependency injection is usually what we call ioc mode. Today we share the ioc mode implemented by typescript language. The main component used here is reflection-metadata, which can acquire or set metadata information. Its function is to get the original data and then create reflections similar to those in C#. First, look at the first. Section ...
Posted by cristal777 on Fri, 19 Jul 2019 22:44:54 -0700
Locating cyclic dependencies in JavaScript/TypeScript using dpdm
When writing large-scale projects, you will accidentally step into the pit of direct circular dependency. The so-called direct circular dependency refers to the situation that other members of the module factory function have direct calls to other modules that depend on themselves. For example:
Suppose there are two modules a.js and b.js, where ...
Posted by onthespot on Fri, 19 Jul 2019 01:20:07 -0700
React Learning (5) - Advanced Applications: Pro Type Check and True Dom Operation
Use PropTypes for type checking
As applications grow, many bug s can be found through type checking.For some applications, you can use JavaScript extension tools, such as Flow or TypeScript To check the whole project.In addition to introducing external tools, React also provides the ability to check parameter types by specifying only one pro ...
Posted by rhodrykorb on Fri, 12 Jul 2019 09:30:36 -0700
From C#to TypeScript - Decorators
From C#to TypeScript - DecoratorsIn C#, if you want to add some extra information or functionality to a class or method without directly modifying it, you can think of Attribute, which is a very convenient function decorator.TypeScript can also use decorators to add additional functionality to classes, functions, attributes, and parameters. Dec ...
Posted by drunknbass on Fri, 05 Jul 2019 09:38:49 -0700
Nest, a TypeScript-based ode.js framework, is officially released! (2)
This article is a translation with the original address: https://kamilmysliwiec.com/nest-final-release-is-here-node-js-framework-built-top-of-typescript Author, @Kamil My liwiec
The address of the last article is: https://segmentfault.com/a/1190000009560532
Middlewares
Middleware is a function that is called before a routing handler. Middlewa ...
Posted by wscreate on Thu, 27 Jun 2019 11:28:50 -0700
Can you play like this?Ultra-functional Typescript built-in and custom types
background
As you all know with Typescript, many times we need to declare a type in advance and assign it to a variable.
For example, in business, we need to render a table and often define:
interface Row {
user: string
email: string
id: number
vip: boolean
// ...
}
const tableDatas: Row[] = []
// ...
Sometimes we also need a search ...
Posted by purefusion on Wed, 05 Jun 2019 09:05:11 -0700
Use Flow to detect your JS
Recently, I saw an introduction about Flow in an article. I think it's very good. Although it's easy to use Typescript in a project before, it's a bit cumbersome to use Flow again, but it's always right to learn more.
brief introduction
JS, as a scripting language, has no type checking. This feature is sometimes used very well, but when you are ...
Posted by Harry57 on Sat, 18 May 2019 15:58:25 -0700
TypeScript Basic Introduction - Class - Advanced Skills
Reprint
TypeScript Basic Introduction - Class - Advanced Skills
Project Practice Warehouse
https://github.com/durban89/typescript_demo.git
tag: 1.1.5
In order to ensure that the following learning demonstration needs to install ts-node, so that each subsequent operation can directly run to see the output results.
npm install -D ts-node
...
Posted by Flukey on Sat, 18 May 2019 04:01:39 -0700
Implement a particle system from 0 to 1
Recently, a small program has been developed that addresses the need for dynamic effects. We originally planned to use a gif diagram to achieve this dynamic effect, but the gif diagram has three drawbacks:
The gif map of high quality kinetics performance is at least 2MB in size.
Too many dynamic details make it difficult to achieve a seamless ...
Posted by scrypted on Thu, 16 May 2019 01:31:39 -0700