@ethlete/query 5.32.4 → 5.33.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 +8 -0
- package/fesm2022/ethlete-query.mjs +77 -34
- package/fesm2022/ethlete-query.mjs.map +1 -1
- package/lib/experimental/http/paged-query-stack.d.ts +11 -2
- package/lib/experimental/http/query-errors.d.ts +3 -1
- package/lib/experimental/http/query-stack.d.ts +2 -0
- package/package.json +5 -5
|
@@ -59,6 +59,11 @@ export type CreatePagedQueryStackOptions<TArgs extends QueryArgs, TNormPaginatio
|
|
|
59
59
|
* @default 1
|
|
60
60
|
*/
|
|
61
61
|
initialPage?: number;
|
|
62
|
+
/**
|
|
63
|
+
* If true, no queries will be executed while the paged query is loading.
|
|
64
|
+
* This is useful if you need the current response to be used in the next query.
|
|
65
|
+
*/
|
|
66
|
+
blockExecutionDuringLoading?: boolean;
|
|
62
67
|
};
|
|
63
68
|
export type PagedQueryStackResetOptions = {
|
|
64
69
|
/**
|
|
@@ -88,9 +93,13 @@ export type PagedQueryStackDirection = 'next' | 'previous';
|
|
|
88
93
|
export type AnyPagedQueryStack = PagedQueryStack<AnyQuery, NormalizedPagination<unknown>>;
|
|
89
94
|
export type PagedQueryStack<TQuery extends AnyQuery, TNormPagination extends NormalizedPagination<unknown>> = {
|
|
90
95
|
/**
|
|
91
|
-
* The
|
|
96
|
+
* The pagination of the last executed query in the paged query.
|
|
97
|
+
*/
|
|
98
|
+
maxPagination: Signal<TNormPagination | null>;
|
|
99
|
+
/**
|
|
100
|
+
* The pagination of the first executed query in the paged query.
|
|
92
101
|
*/
|
|
93
|
-
|
|
102
|
+
minPagination: Signal<TNormPagination | null>;
|
|
94
103
|
/**
|
|
95
104
|
* Fetches the previous page of the paged query.
|
|
96
105
|
*
|
|
@@ -25,7 +25,8 @@ export declare const enum QueryRuntimeErrorCode {
|
|
|
25
25
|
PAGED_QUERY_STACK_NEXT_PAGE_CALLED_WITHOUT_PREVIOUS_PAGE = 401,
|
|
26
26
|
PAGED_QUERY_STACK_PREVIOUS_PAGE_CALLED_BUT_ALREADY_AT_FIRST_PAGE = 402,
|
|
27
27
|
QUERY_STACK_WITH_ARGS_USED = 500,
|
|
28
|
-
QUERY_STACK_WITH_RESPONSE_UPDATE_USED = 501
|
|
28
|
+
QUERY_STACK_WITH_RESPONSE_UPDATE_USED = 501,
|
|
29
|
+
QUERY_STACK_TOTAL_QUERIES_AND_EXPECTED_QUERIES_MISMATCH = 502
|
|
29
30
|
}
|
|
30
31
|
export declare const queryFeatureUsedMultipleTimes: (type: QueryFeatureType) => RuntimeError<QueryRuntimeErrorCode.QUERY_FEATURE_USED_MULTIPLE_TIMES>;
|
|
31
32
|
export declare const withArgsQueryFeatureMissingButRouteIsFunction: () => RuntimeError<QueryRuntimeErrorCode.WITH_ARGS_QUERY_FEATURE_MISSING_BUT_ROUTE_IS_FUNCTION>;
|
|
@@ -52,3 +53,4 @@ export declare const pagedQueryStackNextPageCalledWithoutPreviousPage: () => Run
|
|
|
52
53
|
export declare const pagedQueryStackPreviousPageCalledButAlreadyAtFirstPage: () => RuntimeError<QueryRuntimeErrorCode.PAGED_QUERY_STACK_PREVIOUS_PAGE_CALLED_BUT_ALREADY_AT_FIRST_PAGE>;
|
|
53
54
|
export declare const queryStackWithArgsUsed: () => RuntimeError<QueryRuntimeErrorCode.QUERY_STACK_WITH_ARGS_USED>;
|
|
54
55
|
export declare const queryStackWithResponseUpdateUsed: () => RuntimeError<QueryRuntimeErrorCode.QUERY_STACK_WITH_RESPONSE_UPDATE_USED>;
|
|
56
|
+
export declare const queryStackTotalQueriesAndExpectedQueriesMismatch: (totalQueries: number, expectedQueries: number) => RuntimeError<QueryRuntimeErrorCode.QUERY_STACK_TOTAL_QUERIES_AND_EXPECTED_QUERIES_MISMATCH>;
|
|
@@ -6,6 +6,8 @@ import { QueryFeature } from './query-features';
|
|
|
6
6
|
export type QueryStack<TQuery extends AnyQuery, TTransform> = {
|
|
7
7
|
/** Contains all queries in the stack. */
|
|
8
8
|
queries: Signal<TQuery[]>;
|
|
9
|
+
/** Contains the first query in the stack. */
|
|
10
|
+
firstQuery: Signal<TQuery | null>;
|
|
9
11
|
/** Contains the last query in the stack. Useful for getting current pagination values. */
|
|
10
12
|
lastQuery: Signal<TQuery | null>;
|
|
11
13
|
/** True if any query in the stack is loading. */
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ethlete/query",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.33.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@angular/common": "19.2.
|
|
7
|
-
"@angular/core": "19.2.
|
|
8
|
-
"@angular/forms": "19.2.
|
|
9
|
-
"@angular/router": "19.2.
|
|
6
|
+
"@angular/common": "19.2.2",
|
|
7
|
+
"@angular/core": "19.2.2",
|
|
8
|
+
"@angular/forms": "19.2.2",
|
|
9
|
+
"@angular/router": "19.2.2",
|
|
10
10
|
"@ethlete/core": "^4.0.3",
|
|
11
11
|
"@ethlete/types": "^1.6.2",
|
|
12
12
|
"rxjs": "7.8.2",
|