上一页 1 ··· 99 100 101 102 103 104 105 106 107 ··· 496 下一页
摘要: You can DRY up your generics code MASSIVELY (and improve perf) by assigning local variables to default generic slots. Here, we move some complex 'Extr 阅读全文
posted @ 2022-10-20 14:21 Zhentiw 阅读(28) 评论(0) 推荐(0)
摘要: You can use generics to dynamically specify the number, and type, of arguments to functions. Here, we create a sendEvent function which only asks for 阅读全文
posted @ 2022-10-20 03:09 Zhentiw 阅读(48) 评论(0) 推荐(0)
摘要: Maps values to a new observable on emission from source, subscribing to and emitting results of inner observables By default mergeMap does not limit t 阅读全文
posted @ 2022-10-19 15:13 Zhentiw 阅读(160) 评论(0) 推荐(0)
摘要: Recursively flatten array up to depth times. For example: type a = FlattenDepth<[1, 2, [3, 4], [[[5]]]], 2> // [1, 2, 3, 4, [5]]. flattern 2 times typ 阅读全文
posted @ 2022-10-19 14:54 Zhentiw 阅读(33) 评论(0) 推荐(0)
摘要: const input$ = fromEvent(textInput, 'keyup'); input$.pipe( map(event => { const term = event.target.value; return ajax.getJSON(`https://api.github.com 阅读全文
posted @ 2022-10-18 21:17 Zhentiw 阅读(46) 评论(0) 推荐(0)
摘要: Calling .unsubscribe()will NOT trigger completecallback! const sub = interval(1000).subscribe({ next: (val: any) => { counter.innerHTML = val; }, comp 阅读全文
posted @ 2022-10-18 21:09 Zhentiw 阅读(51) 评论(0) 推荐(0)
摘要: Accessing object values and array members is MUCH more powerful in the type world than it is in the runtime world. Passing a union... RETURNS a union! 阅读全文
posted @ 2022-10-18 20:53 Zhentiw 阅读(31) 评论(0) 推荐(0)
摘要: Implement the type version of lodash's _.flip. Type FlipArguments<T> requires function type T and returns a new function type which has the same retur 阅读全文
posted @ 2022-10-18 19:22 Zhentiw 阅读(37) 评论(0) 推荐(0)
摘要: Implement the type version of Array.reverse For example: type a = Reverse<['a', 'b']> // ['b', 'a'] type b = Reverse<['a', 'b', 'c']> // ['c', 'b', 'a 阅读全文
posted @ 2022-10-18 19:12 Zhentiw 阅读(15) 评论(0) 推荐(0)
摘要: Must have Configure Jest to Run Setup for All Tests with Jest setupFilesAfterEnv We want to include '@testing-library/jest-dom'so that we can have suc 阅读全文
posted @ 2022-10-18 13:59 Zhentiw 阅读(41) 评论(0) 推荐(0)
上一页 1 ··· 99 100 101 102 103 104 105 106 107 ··· 496 下一页