question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to eliminate multiple levels of `subscribe().with()`

See original GitHub issue

I have some async logic like this:

A2B82710-B4D4-48CB-800C-37B78D66FC08

However I don’t want to deal with each level of errs, is there anyway to flatten above nested block and just deal with all the exceptions in one level?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Moicencommented, Jan 10, 2022

@cescoffier I further modified my function with the learned knowledge:

80F6F72F-923A-4A96-BC96-C0FD229419F1

So all the calling methods are simplified:

3DC4D864-E0BE-435B-A50D-FA5A24E3EC36

Thanks for teaching!

0reactions
cescoffiercommented, Jan 11, 2022

Should we close this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to avoid nested subscribe more than two levels
1 Answer 1 ... There are a few options but as I see you need that structure because you need data from the...
Read more >
6 Ways to Unsubscribe from Observables in Angular
1. Use the unsubscribe method ... A Subscription essentially just has an unsubscribe() function to release resources or cancel Observable ...
Read more >
how to overcome multiple levels of relationship expansion?
Solved: I have A CDS entity "Member Agency Contact List," which stores the autonumbers of the related entity "Member Contacts,"
Read more >
Lessons from building large Angular apps: Managing ...
The classic approach is to add property with its type set to Subscription , initialise subscription in ngOnInit method, and unsubscribe in ...
Read more >
Unsubscribing in Angular, the right way | by Ashwin Sathian
Method 1: The Manual Way using unsubscribe() ... Now imagine that your component has many such subscriptions, it can quickly become ... By...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found