i really need help.
I'm confused about how should i manage my async API Calls and error handling using redux thunk middleware.
Option 1
Send essential info to redux thunk middleware (newJobInfo) and ALSO other functions to manage my component state (for example, disable submitting button while making api call)
Error handling: Inside redux thunk middleware using try { } catch { }
Option 2
Keep this functions inside my component and only send essential data to redux thunk middleware
Error handling: Remove try { } catch { } of redux thunk middleware (or keep it and throw new Error inside catch statement) and manage errors with .then() and .catch() inside my component.
In this case, I would think how do I use this action in my project. For example, if I use need to call 'startUpdatingJob' not only with navigate effect, I will use option 2, otherwise, if I only use it once, it is acceptable to use option 1. But in general I would rather use option 2, in this case we keep action logic more consistent, as it has only 1 task to complete.