problem description
use RxJS to simulate the two-click exit function of App.
uses two methods, both of which are not very satisfactory. Is there a better way?
related codes
method 1: the problem with using the bufferTime operator
is that the buffer time of bufferTime does not start with a click, which may cause a value to be issued immediately after a click
click$.pipe(
throttleTime(2000),
tap(() => console.log("one")),
concatMap(() => click$.pipe(
tap(() => console.log("two")),
take(1),
takeUntil(of(1).pipe(delay(2000)))
))
).subscribe(v => console.log("success"))
< hr >
finally see my supplement downstairs