Skip to content

Commit

Permalink
move common option to common options section
Browse files Browse the repository at this point in the history
  • Loading branch information
EskiMojo14 committed Feb 26, 2025
1 parent e8d8162 commit 0b7d07d
Showing 1 changed file with 14 additions and 26 deletions.
40 changes: 14 additions & 26 deletions packages/toolkit/src/query/endpointDefinitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,6 @@ type EndpointDefinitionWithQuery<
meta: BaseQueryMeta<BaseQuery>,
arg: QueryArg,
): unknown
/**
* Defaults to `true`.
*
* Most apps should leave this setting on. The only time it can be a performance issue
* is if an API returns extremely large amounts of data (e.g. 10,000 rows per request) and
* you're unable to paginate it.
*
* For details of how this works, please see the below. When it is set to `false`,
* every request will cause subscribed components to rerender, even when the data has not changed.
*
* @see https://redux-toolkit.js.org/api/other-exports#copywithstructuralsharing
*/
structuralSharing?: boolean

/** A schema for the result *before* it's passed to `transformResponse` */
rawResultSchema?: StandardSchemaV1<BaseQueryResult<BaseQuery>>
Expand Down Expand Up @@ -184,19 +171,6 @@ type EndpointDefinitionWithQueryFn<
transformErrorResponse?: never
rawResultSchema?: never
rawErrorSchema?: never
/**
* Defaults to `true`.
*
* Most apps should leave this setting on. The only time it can be a performance issue
* is if an API returns extremely large amounts of data (e.g. 10,000 rows per request) and
* you're unable to paginate it.
*
* For details of how this works, please see the below. When it is set to `false`,
* every request will cause subscribed components to rerender, even when the data has not changed.
*
* @see https://redux-toolkit.js.org/api/other-exports#copywithstructuralsharing
*/
structuralSharing?: boolean
}

type BaseEndpointTypes<QueryArg, BaseQuery extends BaseQueryFn, ResultType> = {
Expand Down Expand Up @@ -227,6 +201,20 @@ export type BaseEndpointDefinition<
/** A schema for the `meta` property returned by the `query` or `queryFn` */
metaSchema?: StandardSchemaV1<BaseQueryMeta<BaseQuery>>

/**
* Defaults to `true`.
*
* Most apps should leave this setting on. The only time it can be a performance issue
* is if an API returns extremely large amounts of data (e.g. 10,000 rows per request) and
* you're unable to paginate it.
*
* For details of how this works, please see the below. When it is set to `false`,
* every request will cause subscribed components to rerender, even when the data has not changed.
*
* @see https://redux-toolkit.js.org/api/other-exports#copywithstructuralsharing
*/
structuralSharing?: boolean

/* phantom type */
[resultType]?: ResultType
/* phantom type */
Expand Down

0 comments on commit 0b7d07d

Please sign in to comment.