@jswork/nprogress-interceptor
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

nprogress-interceptor

NPorgress interceptor for nx.$api.

version license size download

installation

npm install @jswork/nprogress-interceptor

usage

  1. import css/js:
<link rel="stylesheet" href="https://unpkg.com/nprogress@0.2.0/nprogress.css" />
<script src="https://unpkg.com/nprogress@0.2.0/nprogress.js"></script>
  1. 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.

Readme

Keywords

none

Package Sidebar

Install

npm i @jswork/nprogress-interceptor

Homepage

js.work

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

18.8 kB

Total Files

9

Last publish

Collaborators

  • afeiship