doc/api/testing/subscription.md
Rx.Subscription classRecords information about subscriptions to and unsubscriptions from observable sequences.
Subscription ConstructorSubscription Instance MethodsSubscription Instance PropertiesRx.Subscription(subscribe, unsubscribe)<a href="#rxsubscriptionsubscribe-unsubscribe">#</a> Ⓢ
Creates a new subscription object with the given virtual subscription and unsubscription time.
subscribe (Number): Virtual time at which the subscription occurred.[unsubscribe = Number.MAX_VALUE] (Number): Virtual time at which the unsubscription occurred.var subscription = new Rx.Subscription(200, 1000);
console.log(subscription.subscribe);
// => 200
console.log(subscription.unsubscribe);
// => 1000
Rx.Subscription.prototype.equals(other)<a href="#rxsubscriptionprototypeequalsother">#</a> Ⓢ
Checks whether the given subscription is equal to the current instance.
other (Subscription): Subscription object to check for equality.(Boolean): Returns true if the Subscription equals the other, else false.
var s1 = new Subscription(201, 500);
var s2 = new Subscription(201);
var s3 = new Subscription(201, 500);
console.log(s1.equals(s2));
// => false
console.log(s1.equals(s3));
// => true
Rx.Subscription.prototype.toString()<a href="#rxsubscriptionprototypetostring">#</a> Ⓢ
Returns a string representation of the current Subscription value.
(String): String representation of the current Subscription value.
var s1 = new Subscription(201);
console.log(s1.toString());
// => (201, Infinite)
var s2 = new Subscription(201, 1000);
console.log(s2.toString());
// => (201, 1000)
subscribe<a href="#subscribe">#</a> Ⓢ
Gets the subscription virtual time.
(Number): The subscription virtual time.
var s1 = new Subscription(201);
console.log(s1.subscribe);
// => 201
unsubscribe<a href="#value">#</a> Ⓢ
Gets the unsubscription virtual time.
(Number): The unsubscription virtual time.
var s1 = new Subscription(201, 500);
console.log(s1.unsubscribe);
// => 500