From baf94c388d324235ff1565d3a3c6d9c90f9408e6 Mon Sep 17 00:00:00 2001 From: asvarcas Date: Fri, 18 Nov 2022 19:07:53 -0300 Subject: [PATCH 1/3] Improve useList docs --- docs/useList.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/useList.md b/docs/useList.md index d9085a2a62b..6eca7b2b61d 100644 --- a/docs/useList.md +++ b/docs/useList.md @@ -70,6 +70,7 @@ The `useGetList` parameter accepts the following options: * [`page`](#page) * [`perPage`](#perpage) * [`sort`](#sort) +* [`filterCallback`](#filtercallback) ## `filter` @@ -202,7 +203,7 @@ const { data } = useList({ // ] ``` -## Return Value +## `Return Value` `useGetList` returns an object matching the shape of the `ListContext`: @@ -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. Being able to apply local filters to the fetched data ```jsx const { data } = useList({ @@ -259,4 +261,5 @@ const { data } = useList({ // data will be // [ // { id: 2, name: 'Sylvester' }, -// ] \ No newline at end of file +// ] +``` From 8784c682bec4d2e14ec7c7617ba3e94b11d5ba0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?An=C3=ADbal=20Svarcas?= Date: Sat, 19 Nov 2022 17:36:18 -0300 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Francois Zaninotto --- docs/useList.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/useList.md b/docs/useList.md index 6eca7b2b61d..bb43ab19c87 100644 --- a/docs/useList.md +++ b/docs/useList.md @@ -246,7 +246,7 @@ const { ## `filterCallback` -Property for custom filter definition. Being able to apply local filters to the fetched data +Property for custom filter definition. Lets you apply local filters to the fetched data. ```jsx const { data } = useList({ From 2629227b48253d875baef90aafd19a091e231ee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?An=C3=ADbal=20Svarcas?= Date: Sat, 19 Nov 2022 17:40:15 -0300 Subject: [PATCH 3/3] Applied review --- docs/useList.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/useList.md b/docs/useList.md index bb43ab19c87..dc1b3f72faa 100644 --- a/docs/useList.md +++ b/docs/useList.md @@ -203,7 +203,7 @@ const { data } = useList({ // ] ``` -## `Return Value` +## Return Value `useGetList` returns an object matching the shape of the `ListContext`: