Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feature/testing
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaCuneo committed Oct 8, 2024
2 parents 5ed23ce + b448772 commit 7f57778
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 89 deletions.
148 changes: 69 additions & 79 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
"dependencies": {
"@auth0/auth0-spa-js": "2.1.3",
"@azure/msal-browser": "3.25.0",
"@chakra-ui/icons": "2.2.3",
"@chakra-ui/react": "2.9.5",
"@chakra-ui/icons": "2.2.4",
"@chakra-ui/react": "2.10.1",
"@chakra-ui/theme-tools": "^2.2.5",
"@emotion/react": "11.13.3",
"@emotion/styled": "11.13.0",
"@react-icons/all-files": "4.1.0",
Expand All @@ -21,7 +22,7 @@
"final-form": "4.20.10",
"final-form-arrays": "3.1.0",
"framer-motion": "11.11.1",
"i18next": "23.15.1",
"i18next": "23.15.2",
"js-cookie": "3.0.5",
"lodash-es": "4.17.21",
"ramda": "0.30.1",
Expand Down Expand Up @@ -135,4 +136,4 @@
"public"
]
}
}
}
11 changes: 5 additions & 6 deletions src/features/fetchApiExample/JsonPlaceholderPostsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@ export const PostDataSchema = z.object({

export type PostDataType = z.infer<typeof PostDataSchema>;
const JsonPlaceholderPostsTable = () => {
const { data, isLoading, isFetching, isError, error } /*This also contains error and isSuccess*/ = useFetchPostsQuery(
null,
{
const { data, isLoading, isError, error } /*This also contains error and isSuccess isFetching etc..*/ =
useFetchPostsQuery(null, {
pollingInterval: 30000,
refetchOnReconnect: true,
refetchOnMountOrArgChange: true,
},
);
});
const { t } = useTranslation();

return (
Expand All @@ -32,7 +30,8 @@ const JsonPlaceholderPostsTable = () => {
colorscheme="teal"
variant="striped"
data={data}
isLoading={isLoading || isFetching}
//isFetching here would show the spinner each poll. If you want to show spinner only on initial load, use isLoading
isLoading={isLoading}
isError={isError}
error={error}
schema={PostDataSchema}
Expand Down

0 comments on commit 7f57778

Please sign in to comment.