|
43 | 43 | 12. [์คํจํ ์ฟผ๋ฆฌ์ ๋ํด ์ฌ์์ฒญํ๋ retry](#retry) |
44 | 44 | 13. [onSuccess, onError, onSettled](#onsuccess-onerror-onsettled) - ๐ก **v5 @Deprecated** |
45 | 45 | 14. [select๋ฅผ ์ด์ฉํ ๋ฐ์ดํฐ ๋ณํ](#select) |
46 | | -15. [์ฟผ๋ฆฌ๊ฐ pending ์ํ์ธ ๋์ ๋ณด์ฌ ์ค ์ ์ placeholderData](#placeholderdata) |
| 46 | +15. [์ฟผ๋ฆฌ๊ฐ pending ์ํ์ธ ๋์ ๋ณด์ฌ ์ค ์ ์๋ placeholderData](#placeholderdata) |
47 | 47 | 16. [Paginated ๊ตฌํ์ ์ ์ฉํ keepPreviousData](#keepPreviousData) - ๐ก **v5 @Deprecated** |
48 | 48 | 17. [์ฟผ๋ฆฌ๋ฅผ ๋ณ๋ ฌ(Parallel) ์์ฒญํ ์ ์๋ useQueries](#parallel) |
49 | 49 | 18. [์ข
์ ์ฟผ๋ฆฌ(Dependent Queries)](#dependent-queries) |
@@ -660,6 +660,26 @@ const { |
660 | 660 |
|
661 | 661 | <br /> |
662 | 662 |
|
| 663 | +### notifyOnChangeProps |
| 664 | + |
| 665 | +```tsx |
| 666 | +import { useQuery } from "@tanstack/react-query"; |
| 667 | + |
| 668 | +const { data, dataUpdatedAt } = useQuery({ |
| 669 | + queryKey: ["super-heroes"], |
| 670 | + queryFn: getAllSuperHero, |
| 671 | + notifyOnChangeProps: ["data"], // data ๊ฐ ๋ณ๊ฒฝ์์๋ง ๋ฆฌ๋๋๋ง์ด ๋ฐ์ํ๋ค |
| 672 | +}); |
| 673 | +``` |
| 674 | + |
| 675 | +- notifyOnChangeProps: `string[] | "all" | (() => string[] | "all")` |
| 676 | +- ์ฟผ๋ฆฌ์ ํน์ ํ๋กํผํฐ๋ค์ด ๋ณ๊ฒฝ๋์์ ๋๋ง ๋ฆฌ๋๋๋ง์ด ๋ฐ์ํ๋๋ก ์ค์ ํ ์ ์๋ค. |
| 677 | +- ๋ณ๋๋ก ์ค์ ํ์ง ์์ผ๋ฉด, **์ปดํฌ๋ํธ์์ ์ ๊ทผํ ๊ฐ์ด ๋ณ๊ฒฝ๋์์ ๋** ๋ฆฌ๋๋๋ง์ด ๋ฐ์ํ๋ค (๊ธฐ๋ณธ ๋์). ์ฆ ์ ์์์์ `notifyOnChangeProps`์ ์ค์ ๊ฐ์ ์ฃผ์ง ์์๋ค๋ฉด, `data`, `dataUpdatedAt` ์ค ์ด๋ ํ๋๊ฐ ๋ณ๊ฒฝ๋๋ฉด ๋ฆฌ๋๋๋ง์ด ๋ฐ์ํ๋ค. |
| 678 | +- `"all"`๋ก ์ค์ ํ ๊ฒฝ์ฐ ์ฟผ๋ฆฌ์ ์ด๋ค ํ๋กํผํฐ๊ฐ ๋ณ๊ฒฝ๋๋ ์ปดํฌ๋ํธ๊ฐ ๋ฆฌ๋๋๋ง๋๋ค. |
| 679 | +- ์ฐธ๊ณ : ๊ธฐ๋ณธ ๋์์ [Object.defineProperty()](https://github.com/TanStack/query/pull/1578/files#diff-93f379800fc8abf895eba249b2e2371eda98740aa40fc9f284a8088d190f46c3R506-R514)๋ฅผ ํ์ฉํ๋ค. |
| 680 | + |
| 681 | +<br /> |
| 682 | + |
663 | 683 | ## Parallel |
664 | 684 |
|
665 | 685 | [๋ชฉ์ฐจ ์ด๋](#์ฃผ์-์ปจ์
-๋ฐ-๊ฐ์ด๋-๋ชฉ์ฐจ) |
|
0 commit comments