@astral/mobx-query 1.16.1 → 1.16.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.
@@ -131,6 +131,7 @@ export declare class InfiniteQuery<TResult, TError = void, TIsBackground extends
131
131
  * предполагается, что нужно будет самостоятельно обрабатывать ошибку
132
132
  */
133
133
  async: () => Promise<TResult[]>;
134
+ private get computedData();
134
135
  /**
135
136
  * Вычисляемое свойство, содержащее реактивные данные,
136
137
  * благодаря mobx, при изменении isInvalid, свойство будет вычисляться заново,
@@ -144,6 +144,7 @@ export class InfiniteQuery extends QueryContainer {
144
144
  this.submitValidity = submitValidity;
145
145
  makeObservable(this, {
146
146
  data: computed,
147
+ computedData: computed,
147
148
  infiniteExecutor: computed,
148
149
  forceUpdate: action,
149
150
  async: action,
@@ -179,6 +180,10 @@ export class InfiniteQuery extends QueryContainer {
179
180
  count: this.incrementCount,
180
181
  });
181
182
  }
183
+ get computedData() {
184
+ var _a;
185
+ return (_a = this.storage.data) === null || _a === void 0 ? void 0 : _a.data;
186
+ }
182
187
  /**
183
188
  * Вычисляемое свойство, содержащее реактивные данные,
184
189
  * благодаря mobx, при изменении isInvalid, свойство будет вычисляться заново,
@@ -186,7 +191,6 @@ export class InfiniteQuery extends QueryContainer {
186
191
  * и начнется запрос, в результате которого, данные обновятся
187
192
  */
188
193
  get data() {
189
- var _a;
190
194
  const shouldSync = this.enabledAutoFetch &&
191
195
  !this.isSuccess &&
192
196
  !this.isLoading &&
@@ -197,6 +201,6 @@ export class InfiniteQuery extends QueryContainer {
197
201
  when(() => true, this.proceedSync);
198
202
  }
199
203
  // возвращаем имеющиеся данные
200
- return (_a = this.storage.data) === null || _a === void 0 ? void 0 : _a.data;
204
+ return this.computedData;
201
205
  }
202
206
  }
@@ -131,6 +131,7 @@ export declare class InfiniteQuery<TResult, TError = void, TIsBackground extends
131
131
  * предполагается, что нужно будет самостоятельно обрабатывать ошибку
132
132
  */
133
133
  async: () => Promise<TResult[]>;
134
+ private get computedData();
134
135
  /**
135
136
  * Вычисляемое свойство, содержащее реактивные данные,
136
137
  * благодаря mobx, при изменении isInvalid, свойство будет вычисляться заново,
@@ -147,6 +147,7 @@ class InfiniteQuery extends QueryContainer_1.QueryContainer {
147
147
  this.submitValidity = submitValidity;
148
148
  (0, mobx_1.makeObservable)(this, {
149
149
  data: mobx_1.computed,
150
+ computedData: mobx_1.computed,
150
151
  infiniteExecutor: mobx_1.computed,
151
152
  forceUpdate: mobx_1.action,
152
153
  async: mobx_1.action,
@@ -182,6 +183,10 @@ class InfiniteQuery extends QueryContainer_1.QueryContainer {
182
183
  count: this.incrementCount,
183
184
  });
184
185
  }
186
+ get computedData() {
187
+ var _a;
188
+ return (_a = this.storage.data) === null || _a === void 0 ? void 0 : _a.data;
189
+ }
185
190
  /**
186
191
  * Вычисляемое свойство, содержащее реактивные данные,
187
192
  * благодаря mobx, при изменении isInvalid, свойство будет вычисляться заново,
@@ -189,7 +194,6 @@ class InfiniteQuery extends QueryContainer_1.QueryContainer {
189
194
  * и начнется запрос, в результате которого, данные обновятся
190
195
  */
191
196
  get data() {
192
- var _a;
193
197
  const shouldSync = this.enabledAutoFetch &&
194
198
  !this.isSuccess &&
195
199
  !this.isLoading &&
@@ -200,7 +204,7 @@ class InfiniteQuery extends QueryContainer_1.QueryContainer {
200
204
  (0, mobx_1.when)(() => true, this.proceedSync);
201
205
  }
202
206
  // возвращаем имеющиеся данные
203
- return (_a = this.storage.data) === null || _a === void 0 ? void 0 : _a.data;
207
+ return this.computedData;
204
208
  }
205
209
  }
206
210
  exports.InfiniteQuery = InfiniteQuery;
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "peerDependencies": {
10
10
  "mobx": "^6.0.0"
11
11
  },
12
- "version": "1.16.1",
12
+ "version": "1.16.2",
13
13
  "author": "Astral.Soft",
14
14
  "license": "MIT",
15
15
  "repository": {