update no Stop
This commit is contained in:
parent
ca154ba883
commit
b53968df8b
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@kevisual/query",
|
"name": "@kevisual/query",
|
||||||
"version": "0.0.28",
|
"version": "0.0.29",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"module": "dist/index.js",
|
"module": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
|
@ -44,6 +44,10 @@ export type Result<S = any> = {
|
|||||||
export type DataOpts = Partial<QueryOpts> & {
|
export type DataOpts = Partial<QueryOpts> & {
|
||||||
beforeRequest?: Fn;
|
beforeRequest?: Fn;
|
||||||
afterResponse?: <S = any>(result: Result<S>, ctx?: { req?: any; res?: any; fetch?: any }) => Promise<Result<S>>;
|
afterResponse?: <S = any>(result: Result<S>, ctx?: { req?: any; res?: any; fetch?: any }) => Promise<Result<S>>;
|
||||||
|
/**
|
||||||
|
* 是否在stop的时候不请求
|
||||||
|
*/
|
||||||
|
noStop?: boolean;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* 设置基础响应, 设置 success 和 showError,
|
* 设置基础响应, 设置 success 和 showError,
|
||||||
@ -171,7 +175,7 @@ export class Query {
|
|||||||
req: req,
|
req: req,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (this.stop) {
|
if (this.stop && !options?.noStop) {
|
||||||
const that = this;
|
const that = this;
|
||||||
await new Promise((resolve) => {
|
await new Promise((resolve) => {
|
||||||
let timer = 0;
|
let timer = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user