Polling in React: New Learning Experience

💡 𝗟𝗲𝗮𝗿𝗻𝗲𝗱 𝗦𝗼𝗺𝗲𝘁𝗵𝗶𝗻𝗴 𝗡𝗲𝘄: 𝗣𝗼𝗹𝗹𝗶𝗻𝗴 𝗶𝗻 𝗥𝗲𝗮𝗰𝘁 𝗜 𝗿𝗲𝗰𝗲𝗻𝘁𝗹𝘆 𝗰𝗮𝗺𝗲 𝗮𝗰𝗿𝗼𝘀𝘀 𝗽𝗼𝗹𝗹𝗶𝗻𝗴 while working on a feature, something I hadn’t used before. At its core, 𝗽𝗼𝗹𝗹𝗶𝗻𝗴 is simple: 👉 Re-fetch data at regular intervals to keep the UI updated. But what I found interesting is how you use it: • Poll continuously ⏱️ • OR poll 𝗼𝗻𝗹𝘆 𝘄𝗵𝗲𝗻 𝗻𝗲𝗲𝗱𝗲𝗱 (smarter + more efficient) I explored both approaches and added examples in the image below. 👇 ⚡ 𝗞𝗲𝘆 𝘁𝗮𝗸𝗲𝗮𝘄𝗮𝘆: Use polling thoughtfully to balance real-time updates with performance. Still exploring when to use polling vs WebSockets for real-time systems. 𝗔𝗹𝘄𝗮𝘆𝘀 𝗹𝗲𝗮𝗿𝗻𝗶𝗻𝗴 🚀 #React #FrontendDevelopment #JavaScript #WebDevelopment #Learning #Performance

  • graphical user interface, text, application

Sometimes terminologies are more harder than question in interviews

See more comments

To view or add a comment, sign in

Explore content categories