by madeofpalk · 11y ago · 0 comments
The common pattern I've seen is:
- Dispatch simple actions that contains 'just' a URL
- Have a middleware to take those actions, make the API call (based on the URL in the action), and then dispatch further progress, success and/or failure actions
- Receive the API data in your reducer and transform it before adding it to your store.
That's a pattern that works really nicely and is crazy easy to write tests for.
> 4. We do have one! (checkout .eslintrc) I feel like it is actually even more 'strict' than default Airbnb's one.
Oops sorry!
PS You are also welcome to PR =)