Skip to content

Commit 17d4629

Browse files
authored
Merge pull request #1140 from reduxjs/docs/rtkq-exports
2 parents bdc4e3f + dac5b00 commit 17d4629

File tree

111 files changed

+26
-9786
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+26
-9786
lines changed

docs/api/otherExports.mdx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,32 @@ console.log(nanoid())
2222
// 'dgPXxUz_6fWIQBD8XmiSy'
2323
```
2424

25+
### `miniSerializeError`
26+
27+
The default error serialization function used by `createAsyncThunk`, based on https://github.com/sindresorhus/serialize-error. If its argument is an object (such as an `Error` instance), it returns a plain JS `SerializedError` object that copies over any of the listed fields. Otherwise, it returns a stringified form of the value: `{ message: String(value) }`.
28+
29+
```ts no-transpile
30+
export interface SerializedError {
31+
name?: string
32+
message?: string
33+
stack?: string
34+
code?: string
35+
}
36+
37+
export function miniSerializeError(value: any): SerializedError {}
38+
```
39+
40+
### `copyWithStructuralSharing`
41+
42+
A utility that will recursively merge two similar objects together, preserving existing references if the values appear to be the same. This is used internally to help ensure that re-fetched data keeps using the same references unless the new data has actually changed, to avoid unnecessary re-renders. Otherwise, every re-fetch would likely cause the entire dataset to be replaced and all consuming components to always re-render.
43+
44+
If either of the inputs are not plain JS objects or arrays, the new value is returned.
45+
46+
```ts no-transpile
47+
export function copyWithStructuralSharing<T>(oldObj: any, newObj: T): T
48+
export function copyWithStructuralSharing(oldObj: any, newObj: any): any {}
49+
```
50+
2551
## Exports from Other Libraries
2652

2753
### `createNextState`

query-old/.codesandbox/ci.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

query-old/.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

query-old/.eslintrc.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

query-old/.github/workflows/main.yml

Lines changed: 0 additions & 91 deletions
This file was deleted.

query-old/.github/workflows/size.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

query-old/.prettierignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

query-old/.prettierrc

Lines changed: 0 additions & 15 deletions
This file was deleted.

query-old/LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

query-old/README.md

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)