Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/29.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Rxjs ReplaySubject&;成对的_Javascript_Angular_Typescript_Rxjs_Behaviorsubject - Fatal编程技术网

Javascript Rxjs ReplaySubject&;成对的

Javascript Rxjs ReplaySubject&;成对的,javascript,angular,typescript,rxjs,behaviorsubject,Javascript,Angular,Typescript,Rxjs,Behaviorsubject,我们是否可以将pairwise()与ReplaySubject一起使用,而不是将BehaviorSubject与第一个发出的值一起使用 使用BehaviorSubject我可以设置构造函数中的第一个值,这样pairwise()将使用第一个next()。但是这里我需要重播行为,所以有什么建议吗?使用startWith添加初始值 subject.pipe( startWith(‘第一’), 成对的 )

我们是否可以将
pairwise()
ReplaySubject
一起使用,而不是将
BehaviorSubject
与第一个发出的值一起使用


使用
BehaviorSubject
我可以设置构造函数中的第一个值,这样
pairwise()
将使用第一个
next()
。但是这里我需要重播行为,所以有什么建议吗?

使用
startWith
添加初始值

subject.pipe(
startWith(‘第一’),
成对的
)