Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doc] Improve useList's filterCallback prop description #8404

Merged
merged 3 commits into from
Nov 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions docs/useList.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ The `useGetList` parameter accepts the following options:
* [`page`](#page)
* [`perPage`](#perpage)
* [`sort`](#sort)
* [`filterCallback`](#filtercallback)

## `filter`

Expand Down Expand Up @@ -242,9 +243,10 @@ const {
refetch, // a function that throws an error, as refetch doesn't make sense for local data
} = getGetList({ data });
```

## `filterCallback`

Property for custom filter definition. Being able to apply more complex filters using operators
Property for custom filter definition. Lets you apply local filters to the fetched data.

```jsx
const { data } = useList({
Expand All @@ -259,4 +261,5 @@ const { data } = useList({
// data will be
// [
// { id: 2, name: 'Sylvester' },
// ]
// ]
```