I like the first option because I handle errors in the component and if an error has occurred -> I bring her in state, and thereby the component renders a message that something went wrong
Wouldn't it be easier to treat her in action and immediately enter the store? So you have one source of truth and not have to duplicate the logic to operate the error state in each component.
View the response to
a similar question
About error handling in action I don't like the fact that in the case when the component depend on any data received from the server, then under this component should be in the store to create a separate field to store errors. This moment confuses me, because I want to in the store was only data, and errors were processed directly in the components - kaleb.Zieme commented on March 19th 20 at 09:17
I just want to understand how to do it right, but now everything was clear, thank you! - kaleb.Zieme commented on March 19th 20 at 09:23