theodorusclarence.com blog

Archives
Subscribe
November 13, 2021

🔥 New Post: React Loading State Pattern using Toast & SWR

Hey guys 👋

I just published a blog post about React Loading State Pattern Using Toast & SWR

Managing the react loading state can be a bit annoying, we need to set it manually before and after fetch, then we have to give user feedback whether it succeeded or error, lastly we need to handle the error messages.

With this pattern, we can just easily use the custom hooks and functions, and all of it is managed just like this demo video

CleanShot 2021-11-13 at 16.48.56.gif

Cool right?

The cooler thing is, we only 1 wrapper function to manage it all 🤯

CleanShot 2021-11-13 at 19.07.45.png

Go ahead and check it out on this link.

ps: By the way, I'm still considering if I'm going to use Buttondown or Revue for newsletter service, so bear with me if the email provider may suddenly change.

Don't miss what's next. Subscribe to theodorusclarence.com blog:
Powered by Buttondown, the easiest way to start and grow your newsletter.