better immediately hide user1 and show a loading button and use rxjs's switchmap
better immediately hide user1 and show a loading button and use rxjs's switchmap
Also your proposed solution involves a lot more moving pieces.
Sounds like a 20/80 solution.
Hiding the elements/div would prevent the user from clicking that button.
I don't see how it is 20/80.
Switchmap is just a different way of doing things, and hiding the deiv instead of blocking doesn't add really add more effort as well. So I don't see how it's a lot of effort while also missing a lot of the desired features?
If you're going to start adding logic to hide other elements conditionaly it's prone to become spaguetti. And how would that scale code-wise?
Might as well dim the screen and show a loading spinner to convey to the user that they should wait, a fraction of a second on average.
Remember this is in the context of a LOB app. Not facbook.
Just show a loading spinner from an axios callback and be done with it. It's so fast anyway.
Other libs listen to these events to, for example, show loading spinner on request.
this is a trivial task, it's only going to spaghetti if you go out of your way to make that happen