definition file for "do" operator doesn't match the do(null, fn)
See original GitHub issueRxJS version: 5.5.6 Code to reproduce:
new Observable((observer) => {
observer.next("Yeah !");
observer.error("error !");
}).do(null, err => {
console.log('oops!!!!');
}).subscribe(something => console.log(something));
Expected behavior: Able to use the do(null, fn);
Actual behavior: I can’t compile my application. I have to use a dummy function to make it work.
new Observable((observer) => {
observer.next("Yeah !");
observer.error("error !");
}).do(() => {}, err => {
console.log('oops!!!!');
}).subscribe(something => console.log(something));
Additional information: RxJS 4 had the doOnError, but RxJS 5 merged that operator with the normal " do", with passing a « null » value has the first arguments, but it doesn’t works.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Documentation - Do's and Don'ts - TypeScript
Recommendations for writing d.ts files. ... Do use the types number , string , boolean , and symbol . ... declare function fn(x:...
Read more >"satisfies" operator to ensure an expression matches some ...
I find I have to do this once in a while. I don't think the approach to satisfies is responsible for a situation...
Read more >Is there a way to check for both `null` and `undefined`?
Using a juggling-check, you can test both null and undefined in one hit: if (x == null) {. If you use a strict-check,...
Read more >XPath and XQuery Functions and Operators 3.1 - W3C
This document defines constructor functions, operators, and functions on the datatypes defined in [XML Schema Part 2: Datatypes Second ...
Read more >Condition functions - AWS CloudFormation
Returns true for a condition that evaluates to false or returns false for a condition that evaluates to true . Fn::Not acts as...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m unable to reproduce your error in JavaScript: http://jsbin.com/kewohibice/edit?js,console
I suspect the issue you’re hitting is in TypeScript, in that case you can pass
undefined
and you’ll be fine.Better
I highly suggest you use:
do({ error(err) { console.log('oops' } })
which is more readable and explicit.This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.