We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d7486be commit 9c87635Copy full SHA for 9c87635
content/rxjs/use-ngifas.md
@@ -72,7 +72,7 @@ We can also make our Observable hot so that the Observable will no longer trigge
72
73
This fixes our problem because it means it doesn't matter anymore if we have multiple subscriptions.
74
75
-To do this, we can use for example the `shareReplay` operator.
+To do this, we can use for example the `publishReplay` and `refCount` operators.
76
77
```ts
78
@Component({
@@ -81,7 +81,8 @@ To do this, we can use for example the `shareReplay` operator.
81
})
82
export class SomeComponent implements OnInit, OnDestroy {
83
sharedData$ = data$.pipe(
84
- shareReplay(1)
+ publishReplay(1),
85
+ refCount()
86
);
87
...
88
}
0 commit comments