File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change
1
+ /* globals describe, it, expect */
2
+ var Rx = require ( '../dist/cjs/Rx' ) ;
3
+ var Subscriber = Rx . Subscriber ;
4
+
5
+ describe ( 'Subscriber' , function ( ) {
6
+ it ( 'should have the rxSubscriber symbol' , function ( ) {
7
+ var sub = new Subscriber ( ) ;
8
+ expect ( sub [ Rx . Symbol . rxSubscriber ] ( ) ) . toBe ( sub ) ;
9
+ } ) ;
10
+ } ) ;
Original file line number Diff line number Diff line change @@ -4,11 +4,16 @@ import {tryOrOnError} from './util/tryOrOnError';
4
4
5
5
import { Observer } from './Observer' ;
6
6
import { Subscription } from './Subscription' ;
7
+ import { rxSubscriber } from './symbol/rxSubscriber' ;
7
8
8
9
export class Subscriber < T > extends Subscription < T > implements Observer < T > {
9
10
protected _subscription : Subscription < T > ;
10
11
protected _isUnsubscribed : boolean = false ;
11
12
13
+ [ rxSubscriber ] ( ) {
14
+ return this ;
15
+ }
16
+
12
17
get isUnsubscribed ( ) : boolean {
13
18
const subscription = this . _subscription ;
14
19
if ( subscription ) {
You can’t perform that action at this time.
0 commit comments