@ethlete/query 5.27.0 → 5.28.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @ethlete/query
2
2
 
3
+ ## 5.28.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`ef602b4`](https://github.com/ethlete-io/ethdk/commit/ef602b4265ab4d01c581772687172eb591abfa3e) Thanks [@TomTomB](https://github.com/TomTomB)! - Add `asReadonly` method to query object
8
+
9
+ ## 5.27.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`a479d75`](https://github.com/ethlete-io/ethdk/commit/a479d759c57fdbbae1c4cb96893aa6780049153d) Thanks [@TomTomB](https://github.com/TomTomB)! - Make paged query args nullable
14
+
3
15
  ## 5.27.0
4
16
 
5
17
  ### Minor Changes
@@ -3383,6 +3383,19 @@ const createQueryObject = (options) => {
3383
3383
  const destroy = () => deps.injector.destroy();
3384
3384
  const setResponse = (response) => state.response.set(response);
3385
3385
  const createSnapshot = createQuerySnapshotFn({ state, deps, execute });
3386
+ const asReadonly = () => {
3387
+ const roQuery = {
3388
+ args: state.args.asReadonly(),
3389
+ response: state.response.asReadonly(),
3390
+ latestHttpEvent: state.latestHttpEvent.asReadonly(),
3391
+ loading: state.loading.asReadonly(),
3392
+ error: state.error.asReadonly(),
3393
+ lastTimeExecutedAt: state.lastTimeExecutedAt.asReadonly(),
3394
+ id: normalizeQueryRepositoryKey(execute.currentRepositoryKey),
3395
+ createSnapshot,
3396
+ };
3397
+ return roQuery;
3398
+ };
3386
3399
  const query = {
3387
3400
  execute,
3388
3401
  args: state.args.asReadonly(),
@@ -3394,6 +3407,7 @@ const createQueryObject = (options) => {
3394
3407
  id: normalizeQueryRepositoryKey(execute.currentRepositoryKey),
3395
3408
  createSnapshot,
3396
3409
  reset: execute.reset,
3410
+ asReadonly,
3397
3411
  subtle: {
3398
3412
  destroy,
3399
3413
  setResponse,