T2447
Depends on D11656
Part 2 (of 4 planned) stacked diff for converting Cashtab from a static refresh rate to an on-demand refresh rate depending on Websocket transaction messages
This diff deprecates the useAsyncTimeout custom hook in favor of the useInterval custom hook described at https://overreacted.io/making-setinterval-declarative-with-react-hooks/. This custom hook has the benefit of adjusting the interval on the fly. In testing, useAsyncTimeout did not work with this feature.
useAsyncTimeout as a function predates the Cashtab Mint fork. So, while the benefit of this useInterval function is clear, keep in mind https://en.wiktionary.org/wiki/Chesterton's_fence
Reviewing useAsyncTimeout, the custom hook was necessary due to the way React handles state compared to the useInterval and setTimeout APIs.