Created
August 11, 2016 12:59
-
-
Save joshwcomeau/290ef17709b68b3a0f4b9667e50ec457 to your computer and use it in GitHub Desktop.
Disappointing Ducks
This file contains 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
const casetteStatusReducer = constructReducer('idle', () => ({ | |
[VIEW_CASETTES]: 'selecting', | |
[EJECT_CASETTE]: 'idle', | |
[HIDE_CASETTES]: 'idle', | |
[SELECT_CASETTE]: 'loaded', | |
})); | |
const selectedReducer = constructReducer(null, (state, action) => ({ | |
[SELECT_CASETTE]: action.id, | |
})); | |
const byIdReducer = constructReducer({}, (state, action) => ({ | |
[CASETTES_LIST_RECEIVE]: action.casettes, | |
})); | |
const pageNumberReducer = constructReducer(0, state => ({ | |
[GO_TO_NEXT_CASETTE_PAGE]: state + 1, | |
[GO_TO_PREVIOUS_CASETTE_PAGE]: state - 1, | |
})); | |
const pageLimitReducer = constructReducer(5); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment