rentpath / react-redux-starter-kit

MIT License
3 stars 2 forks source link

Remove redux-actions #25

Open c0 opened 8 years ago

c0 commented 8 years ago

redux-actions doesn't provide much value. createAction is nice, but adds an unneeded abstraction.

This:

const REQUEST_SOMETHING = 'REQUEST_SOMETHING'
const requestSomething = createAction(REQUEST_SOMETHING)

Can easily be converted to:

const REQUEST_SOMETHING = 'REQUEST_SOMETHING'
const requestSomething = params => ({ ...params, type: REQUEST_SOMETHING })
c0 commented 8 years ago

Also, redux-actions adds action.payload, which at first feels right, but practically you end up checking a lot of if (action.payload && action.payload.foo) rather than if (action.foo)