【发布时间】:2019-05-17 18:57:05
【问题描述】:
打字稿中Java双冒号运算符的等价物是什么(如果有的话):
stream.forEach( System.out::println(s));
编辑: 我知道它适用于某些功能,例如:
stream.forEach(console.log);
stream.filter(Boolean);
但是当我使用其他功能时,例如BehaviorSubject“下一个”我的代码中断。我不知道有什么资格让其他两个被引用调用。我想要类似的东西:
stream.pipe(someSubject.next);
代替:
stream.pipe(value => someSubject.next(value));
【问题讨论】:
标签: typescript rxjs