Skip to content

Commit 46c44db

Browse files
committed
feat(lib): initial update
1 parent 48e88fb commit 46c44db

File tree

7 files changed

+2883
-2183
lines changed

7 files changed

+2883
-2183
lines changed

package.json

+15-3
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"@angular/router": "~18.2.13",
7575
"@ngrx/signals": "~18.1.1",
7676
"@ngrx/store": "~18.1.1",
77-
"@reduxjs/toolkit": "~2.5.0",
77+
"@reduxjs/toolkit": "~2.6.0",
7878
"rxjs": "~7.8.1",
7979
"tslib": "~2.8.1",
8080
"zone.js": "~0.14.10"
@@ -159,9 +159,21 @@
159159
"vite-tsconfig-paths": "^4.3.2",
160160
"vitest": "~1.6.0"
161161
},
162-
"packageManager": "pnpm@9.6.0",
162+
"packageManager": "pnpm@10.4.1",
163163
"engines": {
164164
"node": "^18.18.0 || ^20.0.0",
165-
"pnpm": "^9.0.0"
165+
"pnpm": "^10.0.0"
166+
},
167+
"pnpm": {
168+
"onlyBuiltDependencies": [
169+
"@parcel/watcher",
170+
"@swc/core",
171+
"esbuild",
172+
"lmdb",
173+
"msgpackr-extract",
174+
"msw",
175+
"nice-napi",
176+
"nx"
177+
]
166178
}
167179
}

packages/ngrx-rtk-query/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ npm install ngrx-rtk-query @reduxjs/toolkit
3434

3535
| Angular / NgRx | ngrx-rtk-query | @reduxjs/toolkit | Support |
3636
| :------------: | :----------------: | :--------------: | :-----------------: |
37-
| 18.x | >=18.1.0 (signals) | ~2.5.0 | Bugs / New Features |
37+
| 18.x | >=18.2.0 (signals) | ~2.6.0 | Bugs / New Features |
38+
| 18.x | >=18.1.0 (signals) | ~2.5.0 | Bugs |
3839
| 18.x | >=18.0.0 (signals) | ~2.2.5 | Bugs |
3940
| 17.x | >=17.1.x (signals) | ~2.2.1 | Bugs |
4041
| 16.x | >=4.2.x (rxjs) | ~1.9.3 | Critical bugs |

packages/ngrx-rtk-query/core/src/module.ts

+18-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
type Api,
55
type BaseQueryFn,
66
type EndpointDefinitions,
7+
type InfiniteQueryDefinition,
78
type Module,
89
type MutationDefinition,
910
type PrefetchOptions,
@@ -15,8 +16,10 @@ import {
1516
import { buildHooks } from './build-hooks';
1617
import {
1718
type HooksWithUniqueNames,
19+
type InfiniteQueryHooks,
1820
type MutationHooks,
1921
type QueryHooks,
22+
isInfiniteQueryDefinition,
2023
isMutationDefinition,
2124
isQueryDefinition,
2225
} from './types';
@@ -50,7 +53,9 @@ declare module '@reduxjs/toolkit/query' {
5053
? QueryHooks<Definitions[K]>
5154
: Definitions[K] extends MutationDefinition<any, any, any, any, any>
5255
? MutationHooks<Definitions[K]>
53-
: never;
56+
: Definitions[K] extends InfiniteQueryDefinition<any, any, any, any, any>
57+
? InfiniteQueryHooks<Definitions[K]>
58+
: never;
5459
};
5560
/**
5661
* A hook that accepts a string endpoint name, and provides a callback that when called,
@@ -126,7 +131,7 @@ export const angularHooksModule = ({
126131
name: angularHooksModuleName,
127132
init(api, { serializeQueryArgs }, context) {
128133
const anyApi = api as any as Api<any, Record<string, any>, any, any, AngularHooksModule>;
129-
const { buildQueryHooks, buildMutationHook, usePrefetch } = buildHooks({
134+
const { buildQueryHooks, buildInfiniteQueryHooks, buildMutationHook, usePrefetch } = buildHooks({
130135
api,
131136
moduleOptions: { hooks, createSelector, getInjector },
132137
serializeQueryArgs,
@@ -151,10 +156,20 @@ export const angularHooksModule = ({
151156
});
152157
(api as any)[`use${capitalize(endpointName)}Query`] = useQuery;
153158
(api as any)[`useLazy${capitalize(endpointName)}Query`] = useLazyQuery;
154-
} else if (isMutationDefinition(definition)) {
159+
}
160+
if (isMutationDefinition(definition)) {
155161
const { useMutation } = buildMutationHook(endpointName);
156162
safeAssign(anyApi.endpoints[endpointName], { useMutation });
157163
(api as any)[`use${capitalize(endpointName)}Mutation`] = useMutation;
164+
} else if (isInfiniteQueryDefinition(definition)) {
165+
const { useInfiniteQuery, useInfiniteQuerySubscription, useInfiniteQueryState } =
166+
buildInfiniteQueryHooks(endpointName);
167+
safeAssign(anyApi.endpoints[endpointName], {
168+
useInfiniteQuery,
169+
useInfiniteQuerySubscription,
170+
useInfiniteQueryState,
171+
});
172+
(api as any)[`use${capitalize(endpointName)}InfiniteQuery`] = useInfiniteQuery;
158173
}
159174
},
160175
};

0 commit comments

Comments
 (0)