@astral/mobx-query 1.2.0 → 1.2.2
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.
|
@@ -29,7 +29,7 @@ export declare class AuxiliaryQuery<TResult, TError = void> {
|
|
|
29
29
|
/**
|
|
30
30
|
* @description единый промис, для устранения гонки запросов
|
|
31
31
|
*/
|
|
32
|
-
|
|
32
|
+
unifiedPromise?: Promise<TResult>;
|
|
33
33
|
constructor();
|
|
34
34
|
/**
|
|
35
35
|
* @description метод ответственный за создание единого промиса,
|
|
@@ -16,6 +16,10 @@ export class AuxiliaryQuery {
|
|
|
16
16
|
* @description флаг обозначающий, что последний запрос был зафейлен
|
|
17
17
|
*/
|
|
18
18
|
this.isError = false;
|
|
19
|
+
/**
|
|
20
|
+
* @description данные о последней ошибке
|
|
21
|
+
*/
|
|
22
|
+
this.error = undefined;
|
|
19
23
|
/**
|
|
20
24
|
* @description флаг, обозначающий успешность завершения последнего запроса
|
|
21
25
|
*/
|
|
@@ -71,6 +75,6 @@ export class AuxiliaryQuery {
|
|
|
71
75
|
this.isError = false;
|
|
72
76
|
this.isSuccess = false;
|
|
73
77
|
};
|
|
74
|
-
makeAutoObservable(this);
|
|
78
|
+
makeAutoObservable(this, { unifiedPromise: false });
|
|
75
79
|
}
|
|
76
80
|
}
|
|
@@ -27,7 +27,6 @@ export class InfiniteQuery {
|
|
|
27
27
|
* @description обработчик успешного запроса, проверяет что мы достигли предела
|
|
28
28
|
*/
|
|
29
29
|
this.submitSuccess = (result, onSuccess, isIncrement) => {
|
|
30
|
-
this.auxiliary.submitSuccess();
|
|
31
30
|
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(result);
|
|
32
31
|
if (isIncrement && this.storage.hasData) {
|
|
33
32
|
this.storage.setData([...this.storage.data, ...result]);
|