tribou / react-template

Build a server-rendered React app and share code across web, React Native, and Electron
Apache License 2.0
4 stars 9 forks source link

Test what it would look like to define redux logic with config files #71

Open tribou opened 6 years ago

tribou commented 6 years ago

The idea would be to find a harmonious balance to hide much of the redux boilerplate behind tests that expose a configuration API. This is similar to how Hapi.js hides implementation details by exposing an extensive configuration API. We would want to balance where to pass functions and where to pass strings/objects. i.e. redux-config might have too much magic?

This would help because:

tribou commented 6 years ago

Another interesting spin on this concept:

https://github.com/infinitered/reduxsauce

Downside is it doesn't adhere to the Flux Standard Action shape. Also, the lib is used by boilerplate that relies heavily on redux-saga for moving all side effects out of action creators (rather than using redux-promise-middleware. To compensate, if we used this lib, it might make the most sense to use redux-observable more frequently. But with observables being inherently difficult to debug still, that doesn't sound like a good trade-off.

tribou commented 6 years ago

Redux docs offers example of creating a reducer based on configuring action handlers: https://redux.js.org/recipes/reducing-boilerplate