What is a loading state?
Loading states are just that — small pockets of time that should be judiciously used to provide the user with visibility on what the system is doing. This is key in helping users feel in control, making them aware of the context at all times, and reassuring them that the right task is effectively being worked on.
When to show loading spinner?
Spinners are best used when you aren't quite sure how long an action is going to take to complete. This could be when waiting for something to buffer or for a user to regain a lost connection.