rikmms / progress-bar-4-axios

Slim progress bar (NProgress) for Web applications that use Axios library for HTTP requests
MIT License
246 stars 32 forks source link

how to disable progress-bar on some special request. #4

Open hooklife opened 6 years ago

rikmms commented 6 years ago

Hi @hooklife

I'll look into it ;-)

survivorbat commented 6 years ago

Would love to see this feature as well 👍

andrehsmendes commented 6 years ago

That would be interesting.

for example, i would hide the bar on certain pages/ route of my application.

kschaper commented 6 years ago

You could use two Axios instances:

import axios from 'axios'
import { loadProgressBar } from 'axios-progress-bar'

const axiosWithProgress = axios.create()
const axiosWithoutProgress = axios.create()

loadProgressBar({}, axiosWithProgress)

axiosWithProgress.get()
axiosWithoutProgress.get()
T0shik commented 5 years ago

I would really like to see this feature as well, love the package.

having two instances is dirty, as soon as you get in to maintaining tokens and interceptors for both of em. using fetch api not to trigger the progress bar faces the same issue.

This functionality is very useful when you want to limit the progress loader to navigation loading, and disable it for searching, uploading files, validation etc...

theonoel commented 4 years ago

Up pls

csicky commented 1 year ago

This would be great to set some flag on the axios request to not show the loading bar. Until then, there is always CSS :)