We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.next()
.pipe()
The following code shows a weird behavior of .pipe():
const RxJs = require('rxjs'); const mySubj$ = new RxJs.Subject(); const doubled$ = mySubj$.pipe( RxJs.map((v) => v * 2), ); mySubj$.subscribe((value) => { console.log('Original value:', value); }); doubled$.subscribe((value) => { console.log('Doubled value:', value); }); mySubj$.next(1); // Logs: // ✅ `Original value: 1` // ✅ `Doubled value: 2` doubled$.next(3); // Logs: // ❌ `Original value: 3` // ❌ `Doubled value: 6`
There's an inconsistency in the APIs exposed by doubled$:
doubled$
.subscribe()
mySubj$
I would expect .next() to fail with not a function.
According to the types, .pipe() returns an Observable (where .next() is not available).
Observable
No response
7.8.2
Currently, this is the workaround to achieve this:
const doubled$ = mySubj$.asObservable().pipe(
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
The following code shows a weird behavior of
.pipe()
:There's an inconsistency in the APIs exposed by
doubled$
:.subscribe()
applies the observable returned by the.pipe()
.next()
applies to source of the.pipe()
(mySubj$
).Expected behavior
I would expect
.next()
to fail with not a function.According to the types,
.pipe()
returns anObservable
(where.next()
is not available).Reproduction code
Reproduction URL
No response
Version
7.8.2
Environment
No response
Additional context
Currently, this is the workaround to achieve this:
The text was updated successfully, but these errors were encountered: