An open API service indexing awesome lists of open source software.

https://github.com/theodorusclarence/react-loading-state-pattern

🔥 Hassle free asynchronous pattern using React Hot Toast, and SWR
https://github.com/theodorusclarence/react-loading-state-pattern

Last synced: 6 months ago
JSON representation

🔥 Hassle free asynchronous pattern using React Hot Toast, and SWR

Awesome Lists containing this project

README

          

# React Loading State Pattern with Toast & SWR

![react-loading-state-pattern](https://socialify.git.ci/theodorusclarence/react-loading-state-pattern/image?description=1&language=1&owner=1&pattern=Charlie%20Brown&stargazers=1&theme=Dark)

Check out the full explanation on https://theodorusclarence.com/blog/react-loading-state-pattern

## Code to observe

1. [DismissableToast.tsx](https://github.com/theodorusclarence/react-loading-state-pattern/blob/main/src/components/DismissableToast.tsx)
2. [useLoadingToast.tsx](https://github.com/theodorusclarence/react-loading-state-pattern/blob/main/src/hooks/toast/useLoadingToast.tsx)
3. [useWithToast.tsx](https://github.com/theodorusclarence/react-loading-state-pattern/blob/main/src/hooks/toast/useWithToast.tsx)
4. [defaultToastMessage](https://github.com/theodorusclarence/react-loading-state-pattern/blob/main/src/lib/helper.ts#L52-L58)
5. [Normal Implementation](https://github.com/theodorusclarence/react-loading-state-pattern/blob/main/src/pages/normal.tsx)
6. [SWR Implementation](https://github.com/theodorusclarence/react-loading-state-pattern/blob/main/src/pages/swr.tsx)