File tree Expand file tree Collapse file tree 4 files changed +35
-1
lines changed
Expand file tree Collapse file tree 4 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 1+ var Rx = require ( '../../dist/cjs/Rx' ) ;
2+ var RxKitchenSink = require ( '../../dist/cjs/Rx.KitchenSink' ) ;
3+ var Symbol = require ( '../../dist/cjs/util/SymbolShim' ) . SymbolShim ;
4+
5+ describe ( 'rxSubscriber symbol' , function ( ) {
6+ it ( 'should exist on Rx' , function ( ) {
7+ expect ( Rx . Symbol . rxSubscriber ) . toBe ( Symbol . for ( 'rxSubscriber' ) ) ;
8+ } ) ;
9+
10+ it ( 'should exist on Rx.KitchenSink' , function ( ) {
11+ expect ( RxKitchenSink . Symbol . rxSubscriber ) . toBe ( Symbol . for ( 'rxSubscriber' ) ) ;
12+ } ) ;
13+ } ) ;
Original file line number Diff line number Diff line change @@ -146,13 +146,18 @@ import {ImmediateScheduler} from './scheduler/ImmediateScheduler';
146146import { TimeInterval } from './operator/extended/timeInterval' ;
147147import { TestScheduler } from './testing/TestScheduler' ;
148148import { VirtualTimeScheduler } from './scheduler/VirtualTimeScheduler' ;
149+ import { rxSubscriber } from './symbol/rxSubscriber' ;
149150/* tslint:enable:no-unused-variable */
150151
151152/* tslint:disable:no-var-keyword */
152153var Scheduler = {
153154 nextTick,
154155 immediate
155156} ;
157+
158+ var Symbol = {
159+ rxSubscriber
160+ } ;
156161/* tslint:enable:no-var-keyword */
157162
158163export {
@@ -171,5 +176,6 @@ export {
171176 ObjectUnsubscribedError ,
172177 TestScheduler ,
173178 VirtualTimeScheduler ,
174- TimeInterval
179+ TimeInterval ,
180+ Symbol
175181} ;
Original file line number Diff line number Diff line change @@ -122,13 +122,18 @@ import {immediate} from './scheduler/immediate';
122122import { nextTick } from './scheduler/nextTick' ;
123123import { NextTickScheduler } from './scheduler/NextTickScheduler' ;
124124import { ImmediateScheduler } from './scheduler/ImmediateScheduler' ;
125+ import { rxSubscriber } from './symbol/rxSubscriber' ;
125126/* tslint:enable:no-unused-variable */
126127
127128/* tslint:disable:no-var-keyword */
128129var Scheduler = {
129130 nextTick,
130131 immediate
131132} ;
133+
134+ var Symbol = {
135+ rxSubscriber
136+ } ;
132137/* tslint:enable:no-var-keyword */
133138
134139export {
@@ -137,6 +142,7 @@ export {
137142 Observable ,
138143 Subscriber ,
139144 Subscription ,
145+ Symbol ,
140146 AsyncSubject ,
141147 ReplaySubject ,
142148 BehaviorSubject ,
Original file line number Diff line number Diff line change 1+ import { SymbolShim } from '../util/SymbolShim' ;
2+
3+ /**
4+ * rxSubscriber symbol is a symbol for retreiving an "Rx safe" Observer from an object
5+ * "Rx safety" can be defined as an object that has all of the traits of an Rx Subscriber,
6+ * including the ability to add and remove subscriptions to the subscription chain and
7+ * guarantees involving event triggering (can't "next" after unsubscription, etc).
8+ */
9+ export const rxSubscriber = SymbolShim . for ( 'rxSubscriber' ) ;
You can’t perform that action at this time.
0 commit comments