上一页 1 ··· 98 99 100 101 102 103 104 105 106 ··· 496 下一页
摘要: // begin lesson code import { fromEvent, partition } from 'rxjs'; import { filter, pluck } from 'rxjs/operators'; const MOVE_SPEED = 20; let leftPosit 阅读全文
posted @ 2022-10-22 16:31 Zhentiw 阅读(60) 评论(0) 推荐(0)
摘要: const onDestroy$ = new Subject(); fromEvent(document, 'click').pipe( map((event: any) => ({ x: event.clientX, y: event.clientY })), takeUntil(onDestro 阅读全文
posted @ 2022-10-22 16:20 Zhentiw 阅读(32) 评论(0) 推荐(0)
摘要: /* * From */ click$.pipe( mergeMapTo(throwError({ status: 400, message: 'Server error' }).pipe( retryWhen(attempts => { return attempts.pipe( mergeMap 阅读全文
posted @ 2022-10-22 16:13 Zhentiw 阅读(30) 评论(0) 推荐(0)
摘要: You can do some really, really neat stuff with assertion functions inside classes. Here, we assert that the user is logged in and get proper inference 阅读全文
posted @ 2022-10-22 02:23 Zhentiw 阅读(31) 评论(0) 推荐(0)
摘要: Implement a generic Fibonacci<T> that takes a number T and returns its corresponding Fibonacci number. The sequence starts: 1, 1, 2, 3, 5, 8, 13, 21, 阅读全文
posted @ 2022-10-21 18:40 Zhentiw 阅读(23) 评论(0) 推荐(0)
摘要: Implement the type of just-flip-object. Examples: Flip<{ a: "x", b: "y", c: "z" }>; // {x: 'a', y: 'b', z: 'c'} Flip<{ a: 1, b: 2, c: 3 }>; // {1: 'a' 阅读全文
posted @ 2022-10-21 18:34 Zhentiw 阅读(28) 评论(0) 推荐(0)
摘要: From T, pick a set of properties whose type are not assignable to U. For Example type OmitBoolean = OmitByType<{ name: string count: number isReadonly 阅读全文
posted @ 2022-10-20 18:44 Zhentiw 阅读(32) 评论(0) 推荐(0)
摘要: Implement the type version of binary tree inorder traversal. For example: const tree1 = { val: 1, left: null, right: { val: 2, left: { val: 3, left: n 阅读全文
posted @ 2022-10-20 18:41 Zhentiw 阅读(33) 评论(0) 推荐(0)
摘要: The Block, Element, Modifier methodology (BEM) is a popular naming convention for classes in CSS. For example, the block component would be represente 阅读全文
posted @ 2022-10-20 18:29 Zhentiw 阅读(28) 评论(0) 推荐(0)
摘要: catchError will complete the observable, so be careful where you put the catchError: import { fromEvent, empty } from 'rxjs'; import { ajax } from 'rx 阅读全文
posted @ 2022-10-20 14:43 Zhentiw 阅读(139) 评论(0) 推荐(0)
上一页 1 ··· 98 99 100 101 102 103 104 105 106 ··· 496 下一页