vue-resource-progressbar-interceptor

Interceptor that ties a progressbar to all requests, that it is clear that something is loading
1,773 63
Install
npm install vue-resource-progressbar-interceptor
Latest Version:1.1.9
Vue:2
License:ISC
Last Updated:Sep 28, 2017
Links: GitHub  ·  npm
Maintainer: staskjs

vue-resource-progressbar-interceptor

Module attaches interceptors to vue instance which controls progressbar on top of the screen.

Your vue instance should have this vue-progressbar plugin installed and connected.

Installation

$ npm i vue-resource-progressbar-interceptor

Then in your code:

const Vue = require('vue');
const VueResource = require('vue-resource');
const VueProgressBar = require('vue-progress-bar');
const VueResourceProgressBarInterceptor = require('vue-resource-progressbar-interceptor');

Vue.use(VueResource);
Vue.use(VueProgressBar);
Vue.use(VueResourceProgressBarInterceptor);

Configuration

By default progressbar shows for every single request.

In order not to use progressbar for certain requests, use showProgressBar parameter in request.

Like this:

Vue.http.get('/url', { showProgressBar: false })

Configuration options:

Vue.use(VueResourceProgressBarInterceptor, {
  latencyThreshold: 100, // Number of ms before progressbar starts showing, 100 is default
  responseLatency: 50, // Number of ms before progressbar starts reacting to response, 50 is default
                       // Can be used to wait for more requests to kick in under single progress bar
});

Notes

This plugin was inspired by this angular.js version.

Related Packages

vue3-progress

A vue3 component of progress bar.

33,840 29
vue3-progress-bar

A vue3 component of progress bar.

2,471
route-interceptor

A front-end generic route interceptor

1,866 10
vue-github-api

A deadly simple Vue.js plugin to consume GitHub API.

754
vue-progressbar

A lightweight progress bar for vue

599,838 1,441

Version History

Version Released License
1.1.9 ISC
1.1.8 ISC
1.1.7 ISC
1.1.6 ISC
1.1.5 ISC