Debounce any promise-returning function so that at any instant only one call is pending