Created
July 18, 2017 16:40
-
-
Save gurre/c562e382bbc5b956de17e5713c14c2a6 to your computer and use it in GitHub Desktop.
Redux Reducer using Ramda
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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