-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Rx.Symbol.rxSubscriber): add rxSubscriber symbol
- Loading branch information
Showing
4 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
var Rx = require('../../dist/cjs/Rx'); | ||
var RxKitchenSink = require('../../dist/cjs/Rx.KitchenSink'); | ||
var Symbol = require('../../dist/cjs/util/SymbolShim').SymbolShim; | ||
|
||
describe('rxSubscriber symbol', function () { | ||
it('should exist on Rx', function () { | ||
expect(Rx.Symbol.rxSubscriber).toBe(Symbol.for('rxSubscriber')); | ||
}); | ||
|
||
it('should exist on Rx.KitchenSink', function () { | ||
expect(RxKitchenSink.Symbol.rxSubscriber).toBe(Symbol.for('rxSubscriber')); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import {SymbolShim} from '../util/SymbolShim'; | ||
|
||
/** | ||
* rxSubscriber symbol is a symbol for retreiving an "Rx safe" Observer from an object | ||
* "Rx safety" can be defined as an object that has all of the traits of an Rx Subscriber, | ||
* including the ability to add and remove subscriptions to the subscription chain and | ||
* guarantees involving event triggering (can't "next" after unsubscription, etc). | ||
*/ | ||
export const rxSubscriber = SymbolShim.for('rxSubscriber'); |