> 3. At first we had all API interactions in separate folder, and truth to be told it was not very handy. That always felt like one more file to keep track of. Maybe our current design is a a flaw. Open question.
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!