Sobes.tech

Imagine a queue of macro tasks with five `setTimeout` calls, and microtasks infinitely adding new microtasks, for example through recursive `Promise.resolve().then()`. What will happen to the interface and will these five timeouts ever execute? Why?

118

The user quickly types in the search field. What is the difference between `debounce`, `throttle`, and `AbortController` from a UX and network/backend load perspective? Which is better for live search?

118

Implement a `debounce` function that supports immediate invocation at the start of a series of events (`leading`), a trailing invocation at the end of the series by default, and a `debounceFunc.cancel()` method to cancel the scheduled call.

118