【发布时间】:2020-06-03 03:51:35
【问题描述】:
我可能遗漏了一些简单但无法从文档中完全解决的问题。我只是想要一个函数,当被调用时会在 rxjs observable 上发出一个值。
伪代码:
const myFunction = () => true //or whatever value
const myObservable = ... emit true whenever myFunction is called
...use myFunction somewhere where it being called is a useful event so
observers of myObservable can process it
使用 rxjs 调用函数时发出值的标准模式是什么?
【问题讨论】:
-
bindCallback 可能会有所帮助。
标签: rxjs rxjs-observables