Open IllyaHavrulyk opened 1 year ago
To decrease the usage of API calls, two tecniques should be used - debouncing and memoization. Debouncing is used to prevent the calling of an API every time when user changes the input field (types in or deletes one or more symbols). Articles provided offer two implementations of debouncing - one written by ourselves or using a debounce function from lodash library. Memoization is used to prevent two or more API calls woth same parameters. Again, provided articles offer two ways of implementation - one using a lodash function and another one using the React useMemo() hook.
I suppose that we use vanilla JS for debounce and React useMemo() for memoization since lodash is not supported anymore, meaning that it might impact the longevity of the project.
We have problem with input field optimization that whenever any symbol is entered, there will be call to backend. This can cause server blackout.