Skip to content

Commit

Permalink
docs: add setCustomFilter prop in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ogustavo-pereira committed Aug 30, 2022
1 parent 59f4b42 commit c42c9f1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/useList.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,3 +242,21 @@ const {
refetch, // a function that throws an error, as refetch doesn't make sense for local data
} = getGetList({ data });
```
## `setCustomFilter`

Property for custom filter definition. Being able to apply more complex filters using operators

```jsx
const { data } = useList({
data: [
{ id: 1, name: 'Arnold' },
{ id: 2, name: 'Sylvester' },
{ id: 3, name: 'Jean-Claude' },
],
sort: { field: 'name', order: 'ASC' },
setCustomFilter: (record) => record.id > 1 && record.name !== 'Jean-Claude'
});
// data will be
// [
// { id: 2, name: 'Sylvester' },
// ]

0 comments on commit c42c9f1

Please sign in to comment.