Skip to content

Commit 792fa94

Browse files
committed
Update README for debounce option
1 parent d43cc94 commit 792fa94

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

README.md

+17-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ const table = useReactTable({
121121
});
122122
```
123123

124-
## Customization
124+
## Options
125125

126126
- [Custom query param name](#custom-query-param-name)
127127
- [Custom encoder/decoder](#custom-encoderdecoder)
@@ -248,6 +248,22 @@ const stateAndOnChanges = useTableSearchParams(router, {
248248
});
249249
```
250250

251+
### Debounce
252+
253+
You can debounce the reflection of state changes in the query parameters.
254+
255+
- [demo](https://tanstack-table-search-paramsexample-git-56132d-taro28s-projects.vercel.app/debounce)
256+
- [code](https://github.com/taro-28/tanstack-table-search-params/tree/main/examples/next-pages-router/src/pages/debounce.tsx)
257+
258+
```tsx
259+
const stateAndOnChanges = useTableSearchParams(router, {
260+
debounceMilliseconds: {
261+
// Debounce globalFilter by 500 milliseconds
262+
globalFilter: 500,
263+
},
264+
});
265+
```
266+
251267
## Supported
252268

253269
List of supported TanStack table states

packages/tanstack-table-search-params/README.md

+17-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ const table = useReactTable({
121121
});
122122
```
123123

124-
## Customization
124+
## Options
125125

126126
- [Custom query param name](#custom-query-param-name)
127127
- [Custom encoder/decoder](#custom-encoderdecoder)
@@ -248,6 +248,22 @@ const stateAndOnChanges = useTableSearchParams(router, {
248248
});
249249
```
250250

251+
### Debounce
252+
253+
You can debounce the reflection of state changes in the query parameters.
254+
255+
- [demo](https://tanstack-table-search-paramsexample-git-56132d-taro28s-projects.vercel.app/debounce)
256+
- [code](https://github.com/taro-28/tanstack-table-search-params/tree/main/examples/next-pages-router/src/pages/debounce.tsx)
257+
258+
```tsx
259+
const stateAndOnChanges = useTableSearchParams(router, {
260+
debounceMilliseconds: {
261+
// Debounce globalFilter by 500 milliseconds
262+
globalFilter: 500,
263+
},
264+
});
265+
```
266+
251267
## Supported
252268

253269
List of supported TanStack table states

0 commit comments

Comments
 (0)