Skip to content
This repository was archived by the owner on Apr 20, 2018. It is now read-only.

Commit f460a08

Browse files
Fixing example of delaySubscription
1 parent e1fcecb commit f460a08

1 file changed

Lines changed: 16 additions & 18 deletions

File tree

doc/api/core/operators/delaysubscription.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,27 @@ The side-effects of subscribing to the source sequence will be run on the specif
1616

1717
#### Example
1818
```js
19-
console.log('Start %s' new Date().getTime());
19+
var start = Date.now()
2020

2121
var source = Rx.Observable
22-
.range(0, 3)
23-
.delayWithSelector(Rx.Observable.timer(5000))
24-
.timeStamp()
25-
.map(function (x) { return x.value + ':' + x.timestamp; });
22+
.range(0, 3)
23+
.delaySubscription(5000);
2624

2725
var subscription = source.subscribe(
28-
function (x) {
29-
console.log('Next: %s', x);
30-
},
31-
function (err) {
32-
console.log('Error: %s', err);
33-
},
34-
function () {
35-
console.log('Completed');
36-
});
26+
function (x) {
27+
console.log('Next: %s, %s', x, Date.now() - start);
28+
},
29+
function (err) {
30+
console.log('Error: %s', err);
31+
},
32+
function () {
33+
console.log('Completed');
34+
});
3735

38-
// => Next: 0:300
39-
// => Next: 1:400
40-
// => Next: 2:400
41-
// => Completed
36+
//=> Next: 0, 5001
37+
//=> Next: 1, 5002
38+
//=> Next: 2, 5003
39+
//=> Completed
4240
```
4341
### Location
4442

0 commit comments

Comments
 (0)