gpt4 book ai didi

rxjs - RxJs API 中的 bindCallback 和 bindNodeCallback 有什么区别?

转载 作者:行者123 更新时间:2023-12-04 18:59:34 25 4
gpt4 key购买 nike

我想知道bindCallback 和bindNodeCallback 方法有什么区别,在RxJs API ;以及如何知道何时使用一种或另一种。

非常感谢!

最佳答案

唯一的区别是 Node 回调总是将错误作为第一个参数。来自 documentationbindNodeCallback :

The callback function is expected to follow Node.js conventions, where the first argument to the callback is an error, while remaining arguments are the callback result.



RxJS 会考虑到这一点,并连接回调的 error observable 的错误通知机制的参数。这是不可能的 bindCallback ,因为参数没有约定。

关于rxjs - RxJs API 中的 bindCallback 和 bindNodeCallback 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41202873/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com