#Using the async pipe for observables who's data isn't used in a components template?

4 messages · Page 1 of 1 (latest)

hexed otter
#

Occasionally I'll run into a scenario of having an observable that needs to be subscribed to in a component to initialize data in a service, but the observable won't have data to be consumed in the component's template.

I'd still like to use the async pipe to handle the subscription, but it feels odd to make a dummy html element in the template just so I can use the async pipe on the observable. Should I just manually subscribe/unsub in the component and skip the pipe for such a scenario?

next prairie
#

What makes u consider using the async pipe for that? What are you trying to gain from that ?

hexed otter
next prairie