choko-org / redux-boot

Modular Redux bootstrap with asynchronous side-effects.
MIT License
126 stars 7 forks source link

Selector proposal #24

Open lucasconstantino opened 8 years ago

lucasconstantino commented 8 years ago

Redux-boot does not rely on combinators. Sometimes when we need to simply attach reducers from other projects the code can be unnecessarily big. Take as an example the usage of redux-form reducer:

import { reducer } from 'redux-form'

const formModule = {
  reducer: (state, action) => ({
    ...state,
    form: reducer(state.form, action)
  })
}

This is not really bad, but maybe we could do the following:

import { reducer } from 'redux-form'

const formModule = {
  selector: 'form',
  reducer
}

Basically, what this pull-request accomplishes is wrap any reducer and resolve "selector" paths.