@@ -34,7 +34,8 @@ Instead of creating a [ConnectableObservable](/api/index/class/ConnectableObserv
34
34
35
35
<!-- prettier-ignore -->
36
36
``` ts
37
- import { ConnectableObservable , Subject , timer } from ' rxjs' ;
37
+ import { ConnectableObservable , timer , Subject } from ' rxjs' ;
38
+
38
39
// deprecated
39
40
const tick$ = new ConnectableObservable (
40
41
timer (1_000 ),
@@ -44,7 +45,8 @@ tick$.connect();
44
45
45
46
<!-- prettier-ignore -->
46
47
``` ts
47
- import { connectable , Subject , timer } from ' rxjs' ;
48
+ import { connectable , timer , Subject } from ' rxjs' ;
49
+
48
50
// suggested refactor
49
51
const tick$ = connectable (timer (1_000 ), {
50
52
connector : () => new Subject ()
@@ -56,7 +58,8 @@ In situations in which the `refCount` method is used, the [share](/api/operators
56
58
57
59
<!-- prettier-ignore -->
58
60
``` ts
59
- import { ConnectableObservable , Subject , timer } from ' rxjs' ;
61
+ import { ConnectableObservable , timer , Subject } from ' rxjs' ;
62
+
60
63
// deprecated
61
64
const tick$ = new ConnectableObservable (
62
65
timer (1_000 ),
@@ -66,8 +69,8 @@ const tick$ = new ConnectableObservable(
66
69
67
70
<!-- prettier-ignore -->
68
71
``` ts
69
- import { Subject , timer } from ' rxjs' ;
70
- import { share } from ' rxjs/operators ' ;
72
+ import { timer , share , Subject } from ' rxjs' ;
73
+
71
74
// suggested refactor
72
75
const tick$ = timer (1_000 ).pipe (
73
76
share ({ connector : () => new Subject () })
@@ -80,8 +83,8 @@ Where [multicast](/api/operators/multicast) is called with a subject factory, ca
80
83
81
84
<!-- prettier-ignore -->
82
85
``` ts
83
- import { ConnectableObservable , timer , Subject } from ' rxjs' ;
84
- import { multicast } from ' rxjs/operators ' ;
86
+ import { timer , multicast , Subject , ConnectableObservable } from ' rxjs' ;
87
+
85
88
// deprecated
86
89
const tick$ = timer (1_000 ).pipe (
87
90
multicast (() => new Subject ())
@@ -91,6 +94,7 @@ const tick$ = timer(1_000).pipe(
91
94
<!-- prettier-ignore -->
92
95
``` ts
93
96
import { connectable , timer , Subject } from ' rxjs' ;
97
+
94
98
// suggested refactor
95
99
const tick$ = connectable (timer (1_000 ), {
96
100
connector : () => new Subject ()
@@ -101,8 +105,8 @@ Where [multicast](/api/operators/multicast) is called with a subject instance, i
101
105
102
106
<!-- prettier-ignore -->
103
107
``` ts
104
- import { ConnectableObservable , timer , Subject } from ' rxjs' ;
105
- import { multicast } from ' rxjs/operators ' ;
108
+ import { timer , multicast , Subject , ConnectableObservable } from ' rxjs' ;
109
+
106
110
// deprecated
107
111
const tick$ = timer (1_000 ).pipe (
108
112
multicast (new Subject ())
@@ -112,6 +116,7 @@ const tick$ = timer(1_000).pipe(
112
116
<!-- prettier-ignore -->
113
117
``` ts
114
118
import { connectable , timer , Subject } from ' rxjs' ;
119
+
115
120
// suggested refactor
116
121
const tick$ = connectable (timer (1_000 ), {
117
122
connector : () => new Subject (),
@@ -123,8 +128,8 @@ Where [multicast](/api/operators/multicast) is used in conjunction with [refCoun
123
128
124
129
<!-- prettier-ignore -->
125
130
``` ts
126
- import { timer , Subject } from ' rxjs' ;
127
- import { multicast , refCount } from ' rxjs/operators ' ;
131
+ import { timer , multicast , Subject , refCount } from ' rxjs' ;
132
+
128
133
// deprecated
129
134
const tick$ = timer (1_000 ).pipe (
130
135
multicast (() => new Subject ()),
@@ -134,8 +139,8 @@ const tick$ = timer(1_000).pipe(
134
139
135
140
<!-- prettier-ignore -->
136
141
``` ts
137
- import { timer , Subject } from ' rxjs' ;
138
- import { share } from ' rxjs/operators ' ;
142
+ import { timer , share , Subject } from ' rxjs' ;
143
+
139
144
// suggested refactor
140
145
const tick$ = timer (1_000 ).pipe (
141
146
share ({ connector : () => new Subject () })
@@ -146,8 +151,8 @@ Where [multicast](/api/operators/multicast) is used with a selector, it can be r
146
151
147
152
<!-- prettier-ignore -->
148
153
``` ts
149
- import { timer , combineLatest } from ' rxjs' ;
150
- import { multicast } from ' rxjs/operators ' ;
154
+ import { timer , multicast , Subject , combineLatest } from ' rxjs' ;
155
+
151
156
// deprecated
152
157
const tick$ = timer (1_000 ).pipe (
153
158
multicast (
@@ -159,8 +164,8 @@ const tick$ = timer(1_000).pipe(
159
164
160
165
<!-- prettier-ignore -->
161
166
``` ts
162
- import { timer , combineLatest } from ' rxjs' ;
163
- import { connect } from ' rxjs/operators ' ;
167
+ import { timer , connect , combineLatest , Subject } from ' rxjs' ;
168
+
164
169
// suggested refactor
165
170
const tick$ = timer (1_000 ).pipe (
166
171
connect ((source ) => combineLatest ([source , source ]), {
@@ -175,8 +180,8 @@ If you're using [publish](/api/operators/publish) to create a [ConnectableObserv
175
180
176
181
<!-- prettier-ignore -->
177
182
``` ts
178
- import { ConnectableObservable , timer } from ' rxjs' ;
179
- import { publish } from ' rxjs/operators ' ;
183
+ import { timer , publish , ConnectableObservable } from ' rxjs' ;
184
+
180
185
// deprecated
181
186
const tick$ = timer (1_000 ).pipe (
182
187
publish ()
@@ -185,7 +190,8 @@ const tick$ = timer(1_000).pipe(
185
190
186
191
<!-- prettier-ignore -->
187
192
``` ts
188
- import { connectable , timer } from ' rxjs' ;
193
+ import { connectable , timer , Subject } from ' rxjs' ;
194
+
189
195
// suggested refactor
190
196
const tick$ = connectable (timer (1_000 ), {
191
197
connector : () => new Subject <number >(),
@@ -197,8 +203,8 @@ And if [refCount](/api/operators/refCount) is being applied to the result of [pu
197
203
198
204
<!-- prettier-ignore -->
199
205
``` ts
200
- import { timer } from ' rxjs' ;
201
- import { publish , refCount } from ' rxjs/operators ' ;
206
+ import { timer , publish , refCount } from ' rxjs' ;
207
+
202
208
// deprecated
203
209
const tick$ = timer (1_000 ).pipe (
204
210
publish (),
@@ -208,14 +214,14 @@ const tick$ = timer(1_000).pipe(
208
214
209
215
<!-- prettier-ignore -->
210
216
``` ts
211
- import { timer } from ' rxjs' ;
212
- import { share } from ' rxjs/operators ' ;
217
+ import { timer , share } from ' rxjs' ;
218
+
213
219
// suggested refactor
214
220
const tick$ = timer (1_000 ).pipe (
215
221
share ({
216
222
resetOnError: false ,
217
223
resetOnComplete: false ,
218
- resetOnRefCountZero: false ,
224
+ resetOnRefCountZero: false
219
225
})
220
226
);
221
227
```
@@ -224,8 +230,8 @@ If [publish](/api/operators/publish) is being called with a selector, you can us
224
230
225
231
<!-- prettier-ignore -->
226
232
``` ts
227
- import { timer , combineLatest } from ' rxjs' ;
228
- import { publish } from ' rxjs/operators ' ;
233
+ import { timer , publish , combineLatest } from ' rxjs' ;
234
+
229
235
// deprecated
230
236
const tick$ = timer (1_000 ).pipe (
231
237
publish ((source ) => combineLatest ([source , source ]))
@@ -234,8 +240,8 @@ const tick$ = timer(1_000).pipe(
234
240
235
241
<!-- prettier-ignore -->
236
242
``` ts
237
- import { timer , combineLatest } from ' rxjs' ;
238
- import { connect } from ' rxjs/operators ' ;
243
+ import { timer , connect , combineLatest } from ' rxjs' ;
244
+
239
245
// suggested refactor
240
246
const tick$ = timer (1_000 ).pipe (
241
247
connect ((source ) => combineLatest ([source , source ]))
@@ -248,8 +254,8 @@ If you're using [publishBehavior](/api/operators/publishBehavior) to create a [C
248
254
249
255
<!-- prettier-ignore -->
250
256
``` ts
251
- import { ConnectableObservable , timer } from ' rxjs' ;
252
- import { publishBehavior } from ' rxjs/operators ' ;
257
+ import { timer , publishBehavior , ConnectableObservable } from ' rxjs' ;
258
+
253
259
// deprecated
254
260
const tick$ = timer (1_000 ).pipe (
255
261
publishBehavior (0 )
@@ -259,6 +265,7 @@ const tick$ = timer(1_000).pipe(
259
265
<!-- prettier-ignore -->
260
266
``` ts
261
267
import { connectable , timer , BehaviorSubject } from ' rxjs' ;
268
+
262
269
// suggested refactor
263
270
const tick$ = connectable (timer (1_000 ), {
264
271
connector : () => new BehaviorSubject (0 ),
@@ -270,8 +277,8 @@ And if [refCount](/api/operators/refCount) is being applied to the result of [pu
270
277
271
278
<!-- prettier-ignore -->
272
279
``` ts
273
- import { timer } from ' rxjs' ;
274
- import { publishBehavior , refCount } from ' rxjs/operators ' ;
280
+ import { timer , publishBehavior , refCount } from ' rxjs' ;
281
+
275
282
// deprecated
276
283
const tick$ = timer (1_000 ).pipe (
277
284
publishBehavior (0 ),
@@ -281,15 +288,15 @@ const tick$ = timer(1_000).pipe(
281
288
282
289
<!-- prettier-ignore -->
283
290
``` ts
284
- import { timer , BehaviorSubject } from ' rxjs' ;
285
- import { share } from ' rxjs/operators ' ;
291
+ import { timer , share , BehaviorSubject } from ' rxjs' ;
292
+
286
293
// suggested refactor
287
294
const tick$ = timer (1_000 ).pipe (
288
295
share ({
289
296
connector : () => new BehaviorSubject (0 ),
290
297
resetOnError: false ,
291
298
resetOnComplete: false ,
292
- resetOnRefCountZero: false ,
299
+ resetOnRefCountZero: false
293
300
})
294
301
);
295
302
```
@@ -300,8 +307,8 @@ If you're using [publishLast](/api/operators/publishLast) to create a [Connectab
300
307
301
308
<!-- prettier-ignore -->
302
309
``` ts
303
- import { ConnectableObservable , timer } from ' rxjs' ;
304
- import { publishLast } from ' rxjs/operators ' ;
310
+ import { timer , publishLast , ConnectableObservable } from ' rxjs' ;
311
+
305
312
// deprecated
306
313
const tick$ = timer (1_000 ).pipe (
307
314
publishLast ()
@@ -311,6 +318,7 @@ const tick$ = timer(1_000).pipe(
311
318
<!-- prettier-ignore -->
312
319
``` ts
313
320
import { connectable , timer , AsyncSubject } from ' rxjs' ;
321
+
314
322
// suggested refactor
315
323
const tick$ = connectable (timer (1_000 ), {
316
324
connector : () => new AsyncSubject <number >(),
@@ -322,8 +330,8 @@ And if [refCount](/api/operators/refCount) is being applied to the result of [pu
322
330
323
331
<!-- prettier-ignore -->
324
332
``` ts
325
- import { timer } from ' rxjs' ;
326
- import { publishLast , refCount } from ' rxjs/operators ' ;
333
+ import { timer , publishLast , refCount } from ' rxjs' ;
334
+
327
335
// deprecated
328
336
const tick$ = timer (1_000 ).pipe (
329
337
publishLast (),
@@ -333,15 +341,15 @@ const tick$ = timer(1_000).pipe(
333
341
334
342
<!-- prettier-ignore -->
335
343
``` ts
336
- import { timer , AsyncSubject } from ' rxjs' ;
337
- import { share } from ' rxjs/operators ' ;
344
+ import { timer , share , AsyncSubject } from ' rxjs' ;
345
+
338
346
// suggested refactor
339
347
const tick$ = timer (1_000 ).pipe (
340
348
share ({
341
349
connector : () => new AsyncSubject (),
342
350
resetOnError: false ,
343
351
resetOnComplete: false ,
344
- resetOnRefCountZero: false ,
352
+ resetOnRefCountZero: false
345
353
})
346
354
);
347
355
```
@@ -352,8 +360,8 @@ If you're using [publishReplay](/api/operators/publishReplay) to create a [Conne
352
360
353
361
<!-- prettier-ignore -->
354
362
``` ts
355
- import { ConnectableObservable , timer } from ' rxjs' ;
356
- import { publishReplay } from ' rxjs/operators ' ;
363
+ import { timer , publishReplay , ConnectableObservable } from ' rxjs' ;
364
+
357
365
// deprecated
358
366
const tick$ = timer (1_000 ).pipe (
359
367
publishReplay (1 )
@@ -363,6 +371,7 @@ const tick$ = timer(1_000).pipe(
363
371
<!-- prettier-ignore -->
364
372
``` ts
365
373
import { connectable , timer , ReplaySubject } from ' rxjs' ;
374
+
366
375
// suggested refactor
367
376
const tick$ = connectable (timer (1_000 ), {
368
377
connector : () => new ReplaySubject <number >(1 ),
@@ -374,8 +383,8 @@ And if [refCount](/api/operators/refCount) is being applied to the result of [pu
374
383
375
384
<!-- prettier-ignore -->
376
385
``` ts
377
- import { timer } from ' rxjs' ;
378
- import { publishReplay , refCount } from ' rxjs/operators ' ;
386
+ import { timer , publishReplay , refCount } from ' rxjs' ;
387
+
379
388
// deprecated
380
389
const tick$ = timer (1_000 ).pipe (
381
390
publishReplay (1 ),
@@ -385,15 +394,15 @@ const tick$ = timer(1_000).pipe(
385
394
386
395
<!-- prettier-ignore -->
387
396
``` ts
388
- import { timer , ReplaySubject } from ' rxjs' ;
389
- import { share } from ' rxjs/operators ' ;
397
+ import { timer , share , ReplaySubject } from ' rxjs' ;
398
+
390
399
// suggested refactor
391
400
const tick$ = timer (1_000 ).pipe (
392
401
share ({
393
402
connector : () => new ReplaySubject (1 ),
394
403
resetOnError: false ,
395
404
resetOnComplete: false ,
396
- resetOnRefCountZero: false ,
405
+ resetOnRefCountZero: false
397
406
})
398
407
);
399
408
```
@@ -402,8 +411,8 @@ If [publishReplay](/api/operators/publishReplay) is being called with a selector
402
411
403
412
<!-- prettier-ignore -->
404
413
``` ts
405
- import { timer , combineLatest } from ' rxjs' ;
406
- import { publishReplay } from ' rxjs/operators ' ;
414
+ import { timer , publishReplay , combineLatest } from ' rxjs' ;
415
+
407
416
// deprecated
408
417
const tick$ = timer (1_000 ).pipe (
409
418
publishReplay (1 , undefined , (source ) => combineLatest ([source , source ]))
@@ -412,8 +421,8 @@ const tick$ = timer(1_000).pipe(
412
421
413
422
<!-- prettier-ignore -->
414
423
``` ts
415
- import { timer , combineLatest , ReplaySubject } from ' rxjs' ;
416
- import { connect } from ' rxjs/operators ' ;
424
+ import { timer , connect , combineLatest , ReplaySubject } from ' rxjs' ;
425
+
417
426
// suggested refactor
418
427
const tick$ = timer (1_000 ).pipe (
419
428
connect ((source ) => combineLatest ([source , source ]), {
0 commit comments