It's an interesting idea but I think it's better to have actions that are extremely granular. Why would a "FetchBlogPosts" action for example know anything about loading state or error messages? Those are a responsibility of the consuming service or component that dispatches the "FetchBlogPosts" action.
In my apps when I use a store solution (be it Vuex, ngxs or NgRx) I usually have a global store containing a loading flag and error messages, and then the individual feature stores know nothing about those. In my mind it is the consuming component's responsibility to set the loading flag (or better yet just intercept http requests in your router).
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
It's an interesting idea but I think it's better to have actions that are extremely granular. Why would a "FetchBlogPosts" action for example know anything about loading state or error messages? Those are a responsibility of the consuming service or component that dispatches the "FetchBlogPosts" action.
In my apps when I use a store solution (be it Vuex, ngxs or NgRx) I usually have a global store containing a loading flag and error messages, and then the individual feature stores know nothing about those. In my mind it is the consuming component's responsibility to set the loading flag (or better yet just intercept http requests in your router).