wismer/dm-tool

Perhaps think about having a generic isLoading action

Will-Sommers opened this issue · 0 comments

Within an action, you can have multiple dispatches. It seems like the REQUEST portion of this guy only sets isLoading to true. It might make sense to just have a generic setLoading action that takes a boolean and sets it for you. Then you can have the loading logic, which is tightly coupled to the API response decoupled from the data aspect of your Spells reducer.

You can also then get rid of the dispatch(spellQueryRequest()); line and logic as well.