Hooks để lấy, lưu trữ và cập nhật dữ liệu bất đồng bộ trong React, Solid, Svelte và Vue
Bạn thích thư viện này? Hãy thử toàn bộ TanStack! TanStack Table, TanStack Router, TanStack Virtual, React Charts, React Ranger
Ghé thăm tanstack.com/query để tài liệu, hướng dẫn, API và nhiều hơn nữa!
Vẫn đang sử dụng React Query v2? Không vấn đề gì cả! Xem tài liệu v2 tại đây: https://github.com/TanStack/query/tree/2.x/docs/src/pages/docs.
Vẫn đang sử dụng React Query v3? Không vấn đề gì cả! Xem tài liệu v3 tại đây: https://tanstack.com/query/v3/docs/.
Tính năng nhanh
- Lấy dữ liệu bất kỳ giao thức/phía sau nào (REST, GraphQL, promises, bất kỳ thứ gì!)
- Tự động lưu trữ + tải lại (stale-while-revalidate, tập trung lại cửa sổ, đánh giá chu kỳ/Thời gian thực)
- Truy vấn song song + phụ thuộc
- Thay đổi + Tải lại truy vấn phản ứng
- Bộ nhớ đệm đa tầng + Tự động Thu gom rác
- Truy vấn phân trang + dựa trên con trỏ
- Tải thêm + Truy vấn cuộn vô hạn với Khôi phục cuộn
- Hủy yêu cầu
- React Suspense + Truy vấn Trước khi tải khi Hiển thị
- Công cụ Devtools riêng biệt
- (phụ thuộc vào tính năng đã nhập)
.gitignore
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
node_modules
package-lock.json
yarn.lock
# builds
types
*/**/build
*/**/dist
*/**/lib
*/**/es
artifacts
.rpt2_cache
coverage
*.tgz
# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local
.next
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.history
size-plugin.json
stats-hydration.json
stats.json
stats.html
.vscode/settings.json
*.log
.DS_Store
.cache
.idea
nx-cloud.env
.all-contributorsrc
{
"projectName": "query",
"projectOwner": "TanStack",
"repoType": "github",
"repoHost": "https://github.com",
"files": [
"README.md"
],
"imageSize": 100,
"commit": false,
"commitConvention": "none",
"contributors": [
{
"login": "tannerlinsley",
"name": "Tanner Linsley",
"avatar_url": "https://avatars0.githubusercontent.com/u/5580297?v=4",
"profile": "https://tannerlinsley.com",
"contributions": [
"code",
"ideas",
"example",
"maintenance",
"review"
]
},
{
"login": "cherniavskii",
"name": "Andrew Cherniavskii",
"avatar_url": "https://avatars2.githubusercontent.com/u/13808724?v=4",
"profile": "http://cherniavskii.com",
"contributions": [
"code",
"bug"
]
},
{
"login": "tibotiber",
"name": "Thibaut Tiberghien",
"avatar_url": "https://avatars3.githubusercontent.com/u/5635553?v=4",
"profile": "http://twitter.com/tibotiber",
"contributions": [
"doc"
]
},
{
"login": "gargroh",
"name": "Rohit Garg",
"avatar_url": "https://avatars3.githubusercontent.com/u/42495927?v=4",
"profile": "https://github.com/gargroh",
"contributions": [
"tool"
]
},
{
"login": "Avi98",
"name": "Avinash",
"avatar_url": "https://avatars1.githubusercontent.com/u/26133749?v=4",
"profile": "https://github.com/Avi98",
"contributions": [
"code",
"bug"
]
},
{
"login": "CreativeTechGuy",
"name": "Jason O'Neill",
"avatar_url": "https://avatars1.githubusercontent.com/u/12002072?v=4",
"profile": "https://github.com/CreativeTechGuy",
"contributions": [
"maintenance",
"test"
]
},
{
"login": "bugzpodder",
"name": "Jack Zhao",
"avatar_url": "https://avatars3.githubusercontent.com/u/14841421?v=4",
"profile": "http://fb.me/yz",
"contributions": [
"code",
"bug"
]
},
{
"login": "dpyzo0o",
"name": "dpyzo0o",
"avatar_url": "https://avatars1.githubusercontent.com/u/24768249?v=4",
"profile": "https://github.com/dpyzo0o",
"contributions": [
"code"
]
},
{
"login": "jelteliekens",
"name": "Jelte Liekens",
"avatar_url": "https://avatars1.githubusercontent.com/u/3418474?v=4",
"profile": "https://github.com/jelteliekens",
"contributions": [
"code"
]
},
{
"login": "jgettings",
"name": "Jen Gettings",
"avatar_url": "https://avatars0.githubusercontent.com/u/4183742?v=4",
"profile": "https://github.com/jgettings",
"contributions": [
"code"
]
},
{
"login": "justincy",
"name": "Justin",
"avatar_url": "https://avatars2.githubusercontent.com/u/1037458?v=4",
"profile": "https://github.com/justincy",
"contributions": [
"code"
]
},
{
"login": "MarceloAlves",
"name": "Marcelo Alves",
"avatar_url": "https://avatars1.githubusercontent.com/u/216782?v=4",
"profile": "http://www.marceloalves.com",
"contributions": [
"code"
]
},
{
"login": "zorzysty",
"name": "Zorza",
"avatar_url": "https://avatars0.githubusercontent.com/u/5398733?v=4",
"profile": "https://github.com/zorzysty",
"contributions": [
"bug",
"code",
"doc"
]
},
{
"login": "tkdodo",
"name": "Dominik Dorfmeister",
"avatar_url": "https://avatars0.githubusercontent.com/u/1021430?v=4",
"profile": "https://tkdodo.eu",
"contributions": [
"code",
"doc",
"maintenance",
"question",
"review"
]
},
{
"login": "KATT",
"name": "Alex Johansson",
"avatar_url": "https://avatars.githubusercontent.com/u/459267?v=4",
"profile": "https://katt.dev",
"contributions": [
"code"
]
},
{
"login": "EddyVinck",
"name": "Eddy",
"avatar_url": "https://avatars.githubusercontent.com/u/23434753?v=4",
"profile": "http://www.eddyvinck.nl",
"contributions": [
"code"
]
},
{
"login": "prateek3255",
"name": "Prateek Surana",
"avatar_url": "https://avatars.githubusercontent.com/u/21277179?v=4",
"profile": "http://prateeksurana.me",
"contributions": [
"code"
]
},
{
"login": "babycourageous",
"name": "Rene Dellefont",
"avatar_url": "https://avatars.githubusercontent.com/u/14936212?v=4",
"profile": "https://github.com/babycourageous",
"contributions": [
"code",
"doc"
]
},
{
"login": "jvuoti",
"name": "Janne Vuoti",
"avatar_url": "https://avatars.githubusercontent.com/u/3702781?v=4",
"profile": "https://github.com/jvuoti",
"contributions": [
"code"
]
},
{
"login": "arnaudbzn",
"name": "Arnaud",
"avatar_url": "https://avatars.githubusercontent.com/u/20332397?v=4",
"profile": "http://seaviewlab.com",
"contributions": [
"code",
"doc"
]
},
{
"login": "zrwsk",
"name": "Jakub Żurawski",
"avatar_url": "https://avatars.githubusercontent.com/u/9089600?v=4",
"profile": "https://github.com/zrwsk",
"contributions": [
"doc"
]
},
{
"login": "ardeora",
"name": "Aryan Deora",
"avatar_url": "https://avatars.githubusercontent.com/u/45807386?v=4",
"profile": "http://www.aryandeora.com",
"contributions": [
"code",
"maintenance"
]
},
{
"login": "jennyckaplan",
"name": "Jen Kaplan",
"avatar_url": "https://avatars.githubusercontent.com/u/25395806?v=4",
"profile": "https://github.com/jennyckaplan",
"contributions": [
"code"
]
},
{
"login": "lukesmurray",
"name": "Luke Murray",
"avatar_url": "https://avatars.githubusercontent.com/u/34020210?v=4",
"profile": "https://lukesmurray.com/",
"contributions": [
"code"
]
},
{
"login": "oscartbeaumont",
"name": "Oscar Beaumont",
"avatar_url": "https://avatars.githubusercontent.com/u/21004798?v=4",
"profile": "https://otbeaumont.me",
"contributions": [
"code"
]
},
{
"login": "DamianOsipiuk",
"name": "Damian Osipiuk",
"avatar_url": "https://avatars.githubusercontent.com/u/28151934?v=4",
"profile": "https://github.com/DamianOsipiuk",
"contributions": [
"code",
"maintenance"
]
},
{
"login": "matthewhausman",
"name": "Matthew Hausman",
"avatar_url": "https://avatars.githubusercontent.com/u/25216513?v=4",
"profile": "https://www.linkedin.com/in/matthew-hausman/",
"contributions": [
"code"
]
},
{
"login": "Newbie012",
"name": "Eliya Cohen",
"avatar_url": "https://avatars.githubusercontent.com/u/10504365?v=4",
"profile": "https://github.com/Newbie012",
"contributions": [
"code"
]
},
{
"login": "KubaJastrz",
"name": "Jakub Jastrzębski",
"avatar_url": "https://avatars.githubusercontent.com/u/6443113?v=4",
"profile": "https://kubajastrz.com",
"contributions": [
"code"
]
},
{
"login": "balazsmatepetro",
"name": "Balázs Máté Petró",
"avatar_url": "https://avatars.githubusercontent.com/u/1608725?v=4",
"profile": "https://github.com/balazsmatepetro",
"contributions": [
"code"
]
},
{
"login": "Mamoanwar97",
"name": "Mahmoud M. Anwar",
"avatar_url": "https://avatars.githubusercontent.com/u/36894846?v=4",
"profile": "http://linkedin.com/in/mamoanwar97/",
"contributions": [
"code"
]
},
{
"login": "Moshyfawn",
"name": "moshyfawn",
"avatar_url": "https://avatars.githubusercontent.com/u/16290753?v=4",
"profile": "http://moshyfawn.dev",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
"skipCi": true
}
.browserslistrc
# Browsers we support
Chrome >= 73
Firefox >= 78
Edge >= 79
Safari >= 12.0
iOS >= 12.0
opera >= 53
.editorconfig
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
Chi tiết tải về:
Tác giả: TanStack
Nguồn: https://github.com/TanStack/query
Giấy phép: MIT license
Cảm ơn bạn!