Closed ThomasBurleson closed 7 years ago
Hey @ThomasBurleson! Thank you for these recommendations.
I overlooked the teardown function, great catch!
As the other two go here are my thoughts:
mergeMap().take(1)
because it is an Observable way of acting like a promise. The .take(1)
will close the Observable stream. Using switchMap()
will keep it open which is unncessary for the situation..take(1)
which handles the unsubscribe. Please let me know if I'm wrong in my understanding and I'll be happy to make the changes.
@davideast - understood. I like your technique for mergeMap().take(1)
... thx for your responses.
@ThomasBurleson Thanks for the kind discussion!
index.ts
readFile$
use ofObservable.create()
should return a teardown function.mergmap(...).take(1)
, why not useswitchMap(...)
?angularUniversal()
to prevent memory locks ?