-
In this article we will dive into building the client side of our Youtube to GIF converter. This Article will contain some code snippets but the whole project can be accessed on github which contains the full source code. You can also view the app demo.
-
CodeRabbit
CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
-
Now its time to add the embedded youtube player We will be using the youtube player from react-youtube
-
What we want to achieve here is periodically fetch the GIF Conversion Job data from the backend. This is known as polling. To do this we are going to be using swr which is a data fetching library for React. It is not necessarily used for polling but it has a nice API that supports polling (refreshing data on an interval). Other data fetching libraries with similar capabilities exist most notably React Query. You can also perform polling with axios (using timeouts) however data fetching libraries like swr and React Query provide hooks for data fetching which improves the development experience as well as provide other capabilities such as caching.
Related posts
-
Essential Frontend Resources for Next.js Development 🚀
-
Catch, Optimize Client-Side Data Fetching in Next.js Using SWR
-
Think Twice Before Using setInterval() for API Polling – It Might Not Be Ideal
-
Epic Next JS 14 Tutorial Part 6: Create Video Summary with Next.js and Open AI
-
A day in the life of a developer - Building a dashboard app with SQL, Node.js, Django and Next.js