3 ms·
Awesome to hear that you found it useful. 1. Splitting folders entrypoints — very nice idea! For now i feel it a bit cryptic. 2. Router is the thing we want t
by olegakbarov 11y ago
Awesome to hear that you found it useful.
1. Splitting folders entrypoints — very nice idea! For now i feel it a bit cryptic.
2. Router is the thing we want to tinker with. Gonna give a look into your solution.
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.
4. We do have one! (checkout .eslintrc) I feel like it is actually even more 'strict' than default Airbnb's one.
- madeofpalk 11y ago> 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!
- olegakbarov 11y agoI should definitely take a closer look at this approach. Thank you. PS You are also welcome to PR =)