If you have a bunch of complex reducer logic which you want to slowly migrate over to Riduce, there's an easy way to do this!

All you need to do is wrap your old root reducer in a new function with a ternary:

import initialState from './initialState';
import oldRootReducer from './oldRootReducer';
import riduceReducer from './riduceReducer';

const newRootReducer = (state = initialState, action) => action.leaf
  ? riduceReducer(state)
  : oldReducer(state)

Here's why this works: