You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* `true` will generate a union type for `undefined` properties like: `{ id?: string | undefined }` instead of `{ id?: string }`
67
+
* @default false
68
68
*/
69
69
unionUndefined?: boolean;
70
70
/**
71
-
* defaults to false
72
71
* `true` will result in all generated endpoints having `providesTags`/`invalidatesTags` declarations for the `tags` of their respective operation definition
72
+
* @default false
73
73
* @see https://redux-toolkit.js.org/rtk-query/usage/code-generation for more information
74
74
*/
75
75
tag?: boolean;
76
76
/**
77
-
* defaults to false
78
77
* `true` will add `encodeURIComponent` to the generated path parameters
78
+
* @default false
79
79
*/
80
80
encodePathParams?: boolean;
81
81
/**
82
-
* defaults to false
83
82
* `true` will add `encodeURIComponent` to the generated query parameters
83
+
* @default false
84
84
*/
85
85
encodeQueryParams?: boolean;
86
86
/**
87
-
* defaults to false
88
87
* `true` will "flatten" the arg so that you can do things like `useGetEntityById(1)` instead of `useGetEntityById({ entityId: 1 })`
88
+
* @default false
89
89
*/
90
90
flattenArg?: boolean;
91
91
/**
92
-
* default to false
93
92
* If set to `true`, the default response type will be included in the generated code for all endpoints.
* Adds a case reducer to handle a single exact action type.
33
60
* @remarks
34
-
* All calls to `builder.addCase` must come before any calls to `builder.addMatcher` or `builder.addDefaultCase`.
61
+
* All calls to `builder.addCase` must come before any calls to `builder.addAsyncThunk`, `builder.addMatcher` or `builder.addDefaultCase`.
35
62
* @param actionCreator - Either a plain action type string, or an action creator generated by [`createAction`](./createAction) that can be used to determine the action type.
36
63
* @param reducer - The actual case reducer function.
* Adds case reducers to handle actions based on a `AsyncThunk` action creator.
72
+
* @remarks
73
+
* All calls to `builder.addAsyncThunk` must come before after any calls to `builder.addCase` and before any calls to `builder.addMatcher` or `builder.addDefaultCase`.
74
+
* @param asyncThunk - The async thunk action creator itself.
75
+
* @param reducers - A mapping from each of the `AsyncThunk` action types to the case reducer that should handle those actions.
* Allows you to match your incoming actions against your own filter function instead of only the `action.type` property.
45
88
* @remarks
46
89
* If multiple matcher reducers match, all of them will be executed in the order
47
90
* they were defined in - even if a case reducer already matched.
48
-
* All calls to `builder.addMatcher` must come after any calls to `builder.addCase` and before any calls to `builder.addDefaultCase`.
91
+
* All calls to `builder.addMatcher` must come after any calls to `builder.addCase` and `builder.addAsyncThunk` and before any calls to `builder.addDefaultCase`.
49
92
* @param matcher - A matcher function. In TypeScript, this should be a [type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates)
50
93
* function
51
94
* @param reducer - The actual case reducer function.
0 commit comments