3 ms·
I think I'd go about it using redux-thunk because I feel like render function is not a great place for complex async state changes and chcecking internal status
by scotty79 4y ago
I think I'd go about it using redux-thunk because I feel like render function is not a great place for complex async state changes and chcecking internal status of a promise is a bit low level, but you've built a nice, easy to use thing. If you published it some people might find it to be exactly what they need. Plus they might help you debug some corner cases.
- vbezhenar 4y agoThanks, I'll think about it.
- acemarke 4y agoFYI, we recommend that most folks should not write promise management, data fetching, or loading status tracking code directly If you're using just React, use React Query or something like `react-async`. If you're using Redux, use the "RTK Query" data fetching and caching API in our official Redux Toolkit package: - https://redux.js.org/usage/side-effects-approaches https://redux.js.org/usage/side-effects-approaches