Relative Content

Tag Archive for reactjsrxjs

How to properly debounce a search input field in React?

I’m working on a React application where I need to debounce a search input field. The search field sends a query to an API as the user types, but I want to limit the number of requests by waiting until the user has stopped typing for a brief moment. I’ve tried using setTimeout and clearTimeout inside the onChange handler, but I’m still experiencing issues with rapid API calls.

Send JSON to component

I’m trying to send a JSON payload, getting from my an api, from index.js to a component with rxjs Subject. But in the component, I cannot access the values. Thank you for your hints.