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(‘第一’),
成对的
)