Web and Software Frontend Developer. Used to work in Full-stack JavaScript.Been at this for a few years now, and think I now understand my specific domain pretty well. Still a lot to learn though.
Location
Manchester, UK
Education
Web Systems Design BSc at Sheffield Hallam University, Sheffield, UK
whilst I like the idea of this, I think the UI and the API call should be far more decoupled, so instead I've went for:
// in the useDebounce fileimport{useEffect}from'react';/**
* @description for use in functions with side-effects but no return value
* @export useDebouncedFunction
*/exportdefaultfunctionuseDebouncedFunction(handler,watchedValue,delay){useEffect(()=>{consttimeoutHandler=setTimeout(()=>{handler();},delay);return()=>{clearTimeout(timeoutHandler);};},[watchedValue,delay]);}// in the search fileconst[searchQuery,setSearchQuery]=React.useState('');constfetchX=async()=>{awaitgetX().then((updatedStock:IStockResponse)=>{setX(updated.data??[]);}).catch(err=>{console.error(err);});};useDebouncedFunction(fetchStockVehicles,searchQuery,1000);consthandleSearch=(value:string)=>{setSearchQuery(value??'');};
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
whilst I like the idea of this, I think the UI and the API call should be far more decoupled, so instead I've went for: