上一页 1 ··· 92 93 94 95 96 97 98 99 100 ··· 492 下一页
摘要: Let's say we have a simple app look like this: import { useEffect, useState } from "react"; function useFetch(config) { console.log("useFetch call"); 阅读全文
posted @ 2022-10-26 21:52 Zhentiw 阅读(38) 评论(0) 推荐(0)
摘要: Implement the type version of Lodash.without, Without<T, U> takes an Array T, number or array U and returns an Array without the elements of U. type R 阅读全文
posted @ 2022-10-26 20:53 Zhentiw 阅读(17) 评论(0) 推荐(0)
摘要: Implement TrimRight<T> which takes an exact string type and returns a new string with the whitespace ending removed. For example: type Trimed = TrimRi 阅读全文
posted @ 2022-10-26 18:35 Zhentiw 阅读(20) 评论(0) 推荐(0)
摘要: Let say we have a simple counter app: import { useEffect, useState } from "react"; function useStopwatch() { const [count, setCount] = useState(0); us 阅读全文
posted @ 2022-10-26 14:58 Zhentiw 阅读(29) 评论(0) 推荐(0)
摘要: import { interval, fromEvent, of, merge, empty } from 'rxjs'; import { scan, mapTo, takeWhile, takeUntil, tap, startWith, switchMap } from 'rxjs/opera 阅读全文
posted @ 2022-10-26 14:23 Zhentiw 阅读(32) 评论(0) 推荐(0)
摘要: Fill, a common JavaScript function, now let us implement it with types. Fill<T, N, Start?, End?>, as you can see,Fill accepts four types of parameters 阅读全文
posted @ 2022-10-26 01:02 Zhentiw 阅读(31) 评论(0) 推荐(0)
摘要: https://www.typescriptlang.org/docs/handbook/modules.html#ambient-modules Example for declare node.js "url" & "path" module: node.d.ts declare module 阅读全文
posted @ 2022-10-25 15:01 Zhentiw 阅读(563) 评论(0) 推荐(0)
摘要: https://www.typescriptlang.org/docs/handbook/modules.html#export--and-import--require When you export using `export = ` let numberRegexp = /^[0-9]+$/; 阅读全文
posted @ 2022-10-25 14:36 Zhentiw 阅读(118) 评论(0) 推荐(0)
摘要: Do you know lodash? Chunk is a very useful function in it, now let's implement it. Chunk<T, N> accepts two required type parameters, the T must be a t 阅读全文
posted @ 2022-10-25 03:20 Zhentiw 阅读(22) 评论(0) 推荐(0)
摘要: You might have some changes locally for 3rd party library. For the local implementation, you need to modify the types in order to resolve IDE issue. W 阅读全文
posted @ 2022-10-25 00:09 Zhentiw 阅读(28) 评论(0) 推荐(0)
上一页 1 ··· 92 93 94 95 96 97 98 99 100 ··· 492 下一页