@kevisual/query 0.0.28 → 0.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -94,16 +94,9 @@ type Fn = (opts: {
94
94
  timeout?: number;
95
95
  }) => Promise<Record<string, any> | false>;
96
96
  type QueryOpts$1 = {
97
- url?: string;
98
- headers?: Record<string, string>;
99
- body?: Record<string, any> | FormData;
100
- timeout?: number;
101
- method?: Method;
102
- isBlob?: boolean;
103
- isPostFile?: boolean;
104
97
  adapter?: typeof adapter;
105
98
  [key: string]: any;
106
- };
99
+ } & AdapterOpts;
107
100
  type Data = {
108
101
  path?: string;
109
102
  key?: string;
@@ -134,6 +127,10 @@ type DataOpts = Partial<QueryOpts$1> & {
134
127
  res?: any;
135
128
  fetch?: any;
136
129
  }) => Promise<Result<S>>;
130
+ /**
131
+ * 是否在stop的时候不请求
132
+ */
133
+ noStop?: boolean;
137
134
  };
138
135
  declare const wrapperError: ({ code, message }: {
139
136
  code?: number;
@@ -431,7 +431,7 @@ class Query {
431
431
  code: 500,
432
432
  message: 'api request beforeFn error'});
433
433
  }
434
- if (this.stop) {
434
+ if (this.stop && !options?.noStop) {
435
435
  const that = this;
436
436
  await new Promise((resolve) => {
437
437
  let timer = 0;
package/dist/query.d.ts CHANGED
@@ -94,16 +94,9 @@ type Fn = (opts: {
94
94
  timeout?: number;
95
95
  }) => Promise<Record<string, any> | false>;
96
96
  type QueryOpts = {
97
- url?: string;
98
- headers?: Record<string, string>;
99
- body?: Record<string, any> | FormData;
100
- timeout?: number;
101
- method?: Method;
102
- isBlob?: boolean;
103
- isPostFile?: boolean;
104
97
  adapter?: typeof adapter;
105
98
  [key: string]: any;
106
- };
99
+ } & AdapterOpts;
107
100
  type Data = {
108
101
  path?: string;
109
102
  key?: string;
@@ -134,6 +127,10 @@ type DataOpts = Partial<QueryOpts> & {
134
127
  res?: any;
135
128
  fetch?: any;
136
129
  }) => Promise<Result<S>>;
130
+ /**
131
+ * 是否在stop的时候不请求
132
+ */
133
+ noStop?: boolean;
137
134
  };
138
135
  /**
139
136
  * 设置基础响应, 设置 success 和 showError,
package/dist/query.js CHANGED
@@ -215,7 +215,7 @@ class Query {
215
215
  code: 500,
216
216
  message: 'api request beforeFn error'});
217
217
  }
218
- if (this.stop) {
218
+ if (this.stop && !options?.noStop) {
219
219
  const that = this;
220
220
  await new Promise((resolve) => {
221
221
  let timer = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kevisual/query",
3
- "version": "0.0.28",
3
+ "version": "0.0.29",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",