@@ -81,7 +81,10 @@ export const forkJoin: OperatorDoc = {
81
81
of(5, 6, 7, 8)
82
82
);
83
83
observable.subscribe(
84
- value => console.log(value),
84
+ value => {
85
+ const output = \`<h3>$\{value.toString()\}<h3>\`;
86
+ document.getElementById('output').innerHTML = output;
87
+ },
85
88
err => {},
86
89
() => console.log('This is how it ends!')
87
90
);
@@ -102,7 +105,10 @@ export const forkJoin: OperatorDoc = {
102
105
interval(500).pipe(take(4)) // emit 0, 1, 2, 3 every half a second and complete
103
106
);
104
107
observable.subscribe(
105
- value => console.log(value),
108
+ value => {
109
+ const output = \`<h3>$\{value.toString()\}<h3>\`;
110
+ document.getElementById('output').innerHTML = output;
111
+ },
106
112
err => {},
107
113
() => console.log('This is how it ends!')
108
114
);
@@ -114,13 +120,20 @@ export const forkJoin: OperatorDoc = {
114
120
{
115
121
name : 'Use forkJoin with project function' ,
116
122
code : `
117
- const observable = Rx.Observable.forkJoin(
118
- Rx.Observable.interval(1000).take(3), // emit 0, 1, 2 every second and complete
119
- Rx.Observable.interval(500).take(4), // emit 0, 1, 2, 3 every half a second and complete
123
+ import { take } from 'rxjs/operators';
124
+ import { forkJoin } from 'rxjs/observable/forkJoin';
125
+ import { interval } from 'rxjs/observable/interval';
126
+
127
+ const observable = forkJoin(
128
+ interval(1000).pipe(take(3)), // emit 0, 1, 2 every second and complete
129
+ interval(500).pipe(take(4)), // emit 0, 1, 2, 3 every half a second and complete
120
130
(n, m) => n + m
121
131
);
122
132
observable.subscribe(
123
- value => console.log(value),
133
+ value => {
134
+ const output = \`<h3>$\{value.toString()\}<h3>\`;
135
+ document.getElementById('output').innerHTML = output;
136
+ },
124
137
err => {},
125
138
() => console.log('This is how it ends!')
126
139
);
0 commit comments