Skip to content

Commit

Permalink
Merge pull request #8404 from marmelab/fix-uselist-doc
Browse files Browse the repository at this point in the history
[Doc] Improve `useList`'s `filterCallback` prop description
  • Loading branch information
fzaninotto authored Nov 20, 2022
2 parents 9b2349d + 2629227 commit da30eab
Showing 1 changed file with 5 additions and 2 deletions.
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' },
// ]
// ]
```

0 comments on commit da30eab

Please sign in to comment.