Exam4Training

What are three key steps to implement this debounce function?

Universal Containers (UC) notices that its application that allows users to search for accounts makes a network request each time a key is pressed. This results in too many requests for the server to handle.

Address this problem, UC decides to implement a debounce function on string change handler.

What are three key steps to implement this debounce function? Choose 3 answers:
A . If there is an existing setTimeout and the search string change, allow the existing setTimeout to finish, and do not enqueue a new setTimeout.
B . When the search string changes, enqueue the request within a setTimeout.
C . Ensure that the network request has the property debounce set to true.
D . If there is an existing setTimeout and the search string changes, cancel the existing setTimeout using the persisted timerId and replace it with a new setTimeout.
E . Store the timeId of the setTimeout last enqueued by the search string change handle.

Answer: A,B,C

Exit mobile version