usehooks icon indicating copy to clipboard operation
usehooks copied to clipboard

useAppLoading , usePageLoading hooks for react-query

Open ChaTbiM opened this issue 4 years ago • 0 comments

Hi, made two simple hooks that could be useful that can be used with React Query to handle loading App loading and Page loading useApploading : show loading screen one time only when users enter web app, disappear when react query finish fetching data for the current page (after that it won't show at all )

usePageLoading : show loading every time there are queries fetching with react query, note that when the query is fresh the loading state is false, on the contrary when the query is stale the loading state is true codesandbox example better demo app example

ChaTbiM avatar Nov 17 '20 07:11 ChaTbiM