-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Description
Version: [email protected]
When SubscriberFunction.next
is executed without this
, it will fail silently.
In the following code (CodeSandbox), only 1
and 3
is observed.
import Observable from "core-js/features/observable";
const observer = new Observable((observer) => {
const { next } = observer;
observer.next(1); // Will reach subscriber
next(2); // Will not reach subscriber, and fail silently
observer.next(3); // Will reach subscriber
});
observer.subscribe({
next: (value) => console.log(value)
});
In the console log:
1
3
I believe when calling next(2)
, it should be either:
- Fail with exception
- Succeed/observed (
this
is bound)