1.0.7 • Published 1 year ago

@jswork/weapp-loading-interceptor v1.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

weapp-loading-interceptor

Loading interceptor for weapp.

version license size download

installation

npm install @jswork/weapp-loading-interceptor

usage

import createInterceptors from '@jswork/weapp-loading-interceptor';

const weappLoadingIntercepotrs = createInterceptors({
  onShow: (opts) => {
    wx.showLoading({ title: '加载中', mask: true });
  },
  onHide: (opts) => {
    wx.hideLoading();
  },
});

const opts = {
  adapter: 'UniappRequest',
  slim: true,
  interceptors: [...interceptorRequest, ...interceptorResponse, ...weappLoadingIntercepotrs],
  transformResponse(inResponse) {
    return inResponse.data;
  },
};

nx.$api = httpSchema(schema, opts);

license

Code released under the MIT license.

1.0.7

1 year ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago