[RxJS] Remember previous value by using pairwise operator
时间:2020-04-08 17:49:06
收藏:0
阅读:82
pairwise() will remember the last emit value.
const src = interval(1000) .pipe( pairwise(), scan((acc, [prev, curr]) => { console.log(prev, curr) return acc + curr; }, 0) ).subscribe() // 0 1
原文:https://www.cnblogs.com/Answer1215/p/12660363.html
评论(0)