Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Written by Prashant Basnet
<section class="bg-white dark:bg-gray-900 px-4 py-8 max-w-2xl mx-auto text-gray-800 dark:text-gray-200">
<h1 class="text-2xl sm:text-3xl font-signature italic font-semibold text-center mb-4">
👋 Welcome — You’ve Landed on My Signature Page
</h1>
<p class="text-base sm:text-lg mb-4">
Hey, I’m <strong class="text-black dark:text-white">Prashant Basnet</strong> — software developmemt engineer at
<a href="https://unisala.com" class="text-indigo-600 dark:text-indigo-400 underline hover:no-underline" target="_blank" rel="noopener noreferrer">
Unisala.com
</a>.
</p>
<p class="text-base sm:text-lg mb-6">
You’re viewing my <strong>Signature</strong>, a digital space where I share what I’m learning, building, and reflecting on, all in one place.
</p>
<div class="border-l-4 border-indigo-400 dark:border-indigo-500 pl-4 italic mb-6 text-sm sm:text-base text-gray-700 dark:text-gray-400">
📍 Found this page via LinkedIn, my personal site, or a shared link?
<br />
This isn’t a traditional portfolio. It’s my public digital notebook where I document useful ideas, experiments, and lessons I’ve learned as I build.
</div>
<h2 class="text-lg font-semibold mb-2">What You’ll Find Here:</h2>
<ul class="list-disc list-inside space-y-1 text-sm sm:text-base">
<li>✍️ Thoughts on algorithms, systems, and software design</li>
<li>🧠 Insights from building at Unisala</li>
<li>🔗 Direct links to everything I’ve published on Unisala</li>
</ul>
</section>
If you’ve ever built a search bar or input form that sends API calls, you’ve probably heard of debounce. Or maybe you’ve created a backend API then you've probably heard about rate limiting.
But here’s the question:
What is Debounce?
Debounce is a programming pattern used to delay the execution of a function until a specified time (t milliseconds) has passed since the last time it was invoked.
🧪 Example Use Case: Search Input
If an API is called on every keystroke, it creates a flood of requests.
A debounced function solves this by waiting until typing has stopped (e.g., 300ms pause), then calling the API once.
📌 Application of Debouncing?
No debounce is not only for typing it's a general technique used in many situation where you want to delay execution until the rapid burst of even has settled down.
Typing is just one common use case but debounce can be applied to any rapid event:
The debounce solution:
If you call the debounced function before the timer expires, it clears the timeout and restarts the timer.
It helps us optimize performance and avoid recalling expensive operations too frequently.
What is Throttle?
Throttle ensures a function can only be called once every t milliseconds, no matter how many times it's triggered.
Application of Throttling:
1. 🖱️ Scroll Event Optimization
window.onscroll fires dozens of times per second, leading to performance issues if you’re triggering expensive computations like:
2. 📦 API Rate Limiting
If users or bots flood your server with too many API calls, it can overwhelm your backend. Restrict API requests to 1 call per t ms per user/IP.
In conclusion:
📞 Debounce = Wait until you stop calling, then I’ll answer.
📡 Throttle = I’ll answer once every 10 seconds, even if you keep calling.