I want to resolve a promise when a list's length is 0. What is the right tool for the job? I think I need to pass two Promises into Promise.race :
- A promise that immediately resolves if
list.length === 0 - A promise that polls the
list.length, and when it's0, it resolves.
I don't like the design of this because it involves polling. Can someone recommend a better implementation or library I should use for this?