Jeff Liu

Results 10 comments of Jeff Liu

@cyh-93 我是这样理解的: 1、正常来说,一次事件循环里所有对dom的操作会合并在一起渲染(对应原文关键词:`还没进重排`、`批量执⾏`) ```javascript let boxes = document.getElmentsByClassName('.box') for(let i = 0; i < boxes.length; i++) { let width = document.getElementById('table') boxes[i].style.color = 'red' } ``` 2、现在,每次循环一开始就会执行一次重排,换句话说,执行一次对dom的操作就会引起一次重排(对应原文关键词:`强制同步布局`) ```javascript let boxes...

```typescript type Includes = T extends [infer P, ...infer Q] ? P extends E ? true : Includes : false type I0 = Includes // false type I1 = Includes...

```typescript type Trim = V extends ` ${infer R}` | `${infer R} ` ? Trim : V type foo = Trim ```

```typescript type DeepFlat = T extends Array ? (R extends any[] ? DeepFlat : R) : T type Deep = [['a'], ['b', 'c'], [['d']], [[[['e']]]]] type DeepTestResult = DeepFlat ```

```typescript type Push = T extends [...infer R] ? [...R, V] : T // 测试用例 type Arr0 = Push // [1] type Arr1 = Push // [1, 2, 3, 4]...

> @IvyLian 感觉需要谷歌一下“css模块儿化最佳实践”:doge: 对的,这道题指的应该是CSS模块化如何做

看了下感觉应该不用这么麻烦,而且用的cache真的会越来越大 我的想法是这样的: ```html {data.map((d) => ( {d} ))} ``` ![image](https://user-images.githubusercontent.com/12411485/153713109-8d11cf88-d64a-424e-ac85-82beb2ada362.png)

Totally agreed! This arrow is very misleading, which confused me for quite a long time...for correctness, as long as parent component rerenders, child components should rerender as well (not if...

> @mderrien29 this is my "prepare-commit-msg" hook, it works for me > > ```shell > #!/bin/sh > . "$(dirname "$0")/_/husky.sh" > > if [ "$2" != "message" ];then > exec...

It is really getting much faster!! Thanks a lot! @XDXX