摘要: // begin lesson code import { interval, fromEvent, of } from 'rxjs'; import { scan, mapTo, takeWhile, takeUntil, tap, startWith, endWith } from 'rxjs/ 阅读全文
posted @ 2022-10-22 16:43 Zhentiw 阅读(28) 评论(0) 推荐(0)
摘要: // 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 阅读(52) 评论(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 阅读(28) 评论(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 阅读(21) 评论(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 阅读(29) 评论(0) 推荐(0)