Rx.Recorded
class
Record of a value including the virtual time it was produced on.
Location
- rx.testing.js
Recorded Constructor
Recorded Instance Methods
Recorded Instance Properties
Recorded Constructor
Rx.Recorded(time, value, [comparer])
Creates a new object recording the production of the specified value at the given virtual time.
参数
time
(Number): Virtual time the value was produced on.value
(Any): Value that was produced[comparer]
(Function): Optional comparer function.
例
var recorded = new Rx.Recorded(200, 'value');
console.log(recorded.time);
// => 200
console.log(recorded.value);
// => value
Location
- rx.js
Recorded Instance Methods
Rx.Recorded.prototype.equals(other)
Checks whether the given recorded object is equal to the current instance.
参数
other
(Recorded): Recorded object to check for equality.
返回值
(Boolean): Returns true
if the Recorded equals the other, else false
.
例
var r1 = new Recorded(201, 'foo');
var r2 = new Recorded(201, 'bar');
var r3 = new Recorded(201, 'foo');
console.log(r1.equals(r2));
// => false
console.log(r1.equals(r3));
// => true
Location
- rx.testing.js
Rx.Recorded.prototype.toString()
Returns a string representation of the current Recorded value.
返回值
(String): String representation of the current Recorded value.
例
var r1 = new Recorded(201, 'foo');
console.log(r1.toString());
// => foo@201
Location
- rx.testing.js
Recorded Instance Properties
time
Gets the virtual time the value was produced on.
返回值
(Number): The virtual time the value was produced on.
例
var r1 = new Recorded(201, 'foo');
console.log(r1.time);
// => 201
Location
- rx.testing.js
value
Gets the recorded value.
返回值
(Number): The recorded value.
例
var r1 = new Recorded(201, 'foo');
console.log(r1.value;
// => foo
Location
- rx.testing.js