Skip to content

Instantly share code, notes, and snippets.

@gurre
Created July 18, 2017 16:40
Show Gist options
  • Save gurre/c562e382bbc5b956de17e5713c14c2a6 to your computer and use it in GitHub Desktop.
Save gurre/c562e382bbc5b956de17e5713c14c2a6 to your computer and use it in GitHub Desktop.
Redux Reducer using Ramda
import R from 'ramda'
import { Jobs } from '../actions/index'
const reducer = (state = [], action) => R.cond([
[ R.equals(Jobs.TYPE.receive), R.always(action.payload) ],
[ R.T, R.always(state) ]
])(action.type)
export default reducer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment