1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
|
# `Rx.Recorded` class #
Record of a value including the virtual time it was produced on.
### Location
- rx.testing.js
## `Recorded Constructor` ##
- [`constructor`](#rxrecordedtime-value-comparer)
## `Recorded Instance Methods` ##
- [`equals`](#rxrecordedprototypeequalsother)
- [`toString`](#rxrecordedprototypetostring)
## `Recorded Instance Properties` ##
- [`time`](#time)
- [`value`](#value)
## _Recorded Constructor_ ##
### <a id="rxrecordedtime-value-comparer"></a>`Rx.Recorded(time, value, [comparer])`
<a href="#rxrecordedtime-value-comparer">#</a> [Ⓢ](https://github.com/Reactive-Extensions/RxJS/blob/master/src/core/testing/recorded.js#L9-L13 "View in source")
Creates a new object recording the production of the specified value at the given virtual time.
#### Arguments
1. `time` *(Number)*: Virtual time the value was produced on.
2. `value` *(Any)*: Value that was produced
3. `[comparer]` *(Function)*: Optional comparer function.
#### Example
```js
var recorded = new Rx.Recorded(200, 'value');
console.log(recorded.time);
// => 200
console.log(recorded.value);
// => value
```
### Location
- rx.js
* * *
## _Recorded Instance Methods_ ##
### <a id="rxrecordedprototypeequalsother"></a>`Rx.Recorded.prototype.equals(other)`
<a href="#rxrecordedprototypeequalsother">#</a> [Ⓢ](https://github.com/Reactive-Extensions/RxJS/blob/master/src/core/testing/recorded.js#L21-L23 "View in source")
Checks whether the given recorded object is equal to the current instance.
#### Arguments
1. `other` *(Recorded)*: Recorded object to check for equality.
#### Returns
*(Boolean)*: Returns `true` if the Recorded equals the other, else `false`.
#### Example
```js
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
* * *
### <a id="rxrecordedprototypetostring"></a>`Rx.Recorded.prototype.toString()`
<a href="#rxrecordedprototypeequalsother">#</a> [Ⓢ](https://github.com/Reactive-Extensions/RxJS/blob/master/src/core/testing/recorded.js#L30-L32 "View in source")
Returns a string representation of the current Recorded value.
#### Returns
*(String)*: String representation of the current Recorded value.
#### Example
```js
var r1 = new Recorded(201, 'foo');
console.log(r1.toString());
// => foo@201
```
### Location
- rx.testing.js
* * *
## _Recorded Instance Properties_ ##
### <a id="time"></a>`time`
<a href="#time">#</a> [Ⓢ](https://github.com/Reactive-Extensions/RxJS/blob/master/src/core/testing/recorded.js#L10 "View in source")
Gets the virtual time the value was produced on.
#### Returns
*(Number)*: The virtual time the value was produced on.
#### Example
```js
var r1 = new Recorded(201, 'foo');
console.log(r1.time);
// => 201
```
### Location
- rx.testing.js
* * *
### <a id="value"></a>`value`
<a href="#value">#</a> [Ⓢ](https://github.com/Reactive-Extensions/RxJS/blob/master/src/core/testing/recorded.js#L11 "View in source")
Gets the recorded value.
#### Returns
*(Number)*: The recorded value.
#### Example
```js
var r1 = new Recorded(201, 'foo');
console.log(r1.value);
// => foo
```
### Location
- rx.testing.js
* * *
|