3 ms·
> Hiding the elements/div would prevent the user from clicking that button. If you're going to start adding logic to hide other elements conditionaly it's pron
by hu3 2y ago
> Hiding the elements/div would prevent the user from clicking that button.
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.
- sabbaticaldev 2y agowhy axios? JS has native fetch everywhere for ages. let’s remove the moving pieces.
- hu3 2y agoAgreed. I'm starting to replace axios with a simple fetch block that emits start/stop/error events. Other libs listen to these events to, for example, show loading spinner on request.
- kitkat_new 2y ago> 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? this is a trivial task, it's only going to spaghetti if you go out of your way to make that happen