@jswork/nprogress-interceptor
v1.0.3
Published
Interceptor for nprogress.
Downloads
5
Readme
nprogress-interceptor
NPorgress interceptor for nx.$api.
installation
npm install @jswork/nprogress-interceptor
usage
- import css/js:
<link rel="stylesheet" href="https://unpkg.com/[email protected]/nprogress.css" />
<script src="https://unpkg.com/[email protected]/nprogress.js"></script>
- Use with
nx.$api
:
import createLoaingIntercepotrs from '@jswork/nprogress-interceptor';
const loadingIntercepotrs = createLoaingIntercepotrs();
const opts = {
adapter: 'Axios',
slim: true,
interceptors: [...interceptorRequest, ...interceptorResponse, ...loadingIntercepotrs],
transformResponse(inResponse) {
return inResponse.data;
},
};
nx.$api = httpSchema(schema, opts);
license
Code released under the MIT license.