A very common pattern in Redux is to use things called a Thunks, which are a way of wrapping up certain logic of a subroutine in a single function.
Read moreWhat is redux-thunk NPM?
Redux Thunk middleware allows you to write action creators that return a function instead of an action . The thunk can be used to delay the dispatch of an action, or to dispatch only if a certain condition is met.26 Kas 2021
Read more