我们可以在一次调用中取消每个流的订阅吗?Unsuscribe事件的每个处理程序
在大多数镖的例子,我们可以看到,以unsuscribe的主要途径是调用从StreamSubscription取消直接方法,但我们需要存储这些订阅...
var s = myElement.onClick.listen(myHandler); //storing the sub
s.Cancel() //unsuscribing the handler
有没有办法取消给定流的每个订阅而不存储它们?
东西可能看起来像这样的:
myElement.onClick.subscriptions.forEach((s)=> s.Cancel());