I usually just use Tanstack Query as an ergonomic wrapper for async functions to get the isLoading variable and define onSuccess, onError, etc. behavior Software Engineering 11Thought 5Programming 5Async 1Query 1 March 14, 2023