DEV Community

Discussion on: Managing API layers in Vue.js with TypeScript

Collapse
 
gabrielhangor profile image
Gabriel Khabibulin

Your implementation looks great and will certainly use this approach for my new project. However, how would you handle loading state/logic to display a spinner or smth in such a case? I've tried to figure it out by myself but couldnt. Thank you.

Collapse
 
blindkai profile image
Blind Kai

If we're talking about Axios and file loading - there is a special callback for this:
onUploadProgress in Request Config.

Talking about loaders, you could implement an interceptor for this case.

Collapse
 
gabrielhangor profile image
Gabriel Khabibulin

Thank you for the reply!