This is RxJS v 4. Find the latest version here
Records information about subscriptions to and unsubscriptions from observable sequences.
- rx.testing.js
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.testing.js
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.testing.js
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)
- rx.testing.js
Gets the subscription virtual time.
(Number): The subscription virtual time.
var s1 = new Subscription(201);
console.log(s1.subscribe);
// => 201
- rx.testing.js
Gets the unsubscription virtual time.
(Number): The unsubscription virtual time.
var s1 = new Subscription(201, 500);
console.log(s1.unsubscribe);
// => 500
- rx.testing.js