1
0
mirror of https://github.com/fspc/workstand.git synced 2025-04-04 10:03:22 -04:00
2017-05-23 19:30:44 -06:00

24 lines
669 B
JavaScript

import { setBikes, setBikesFetched, setBikesIsFetching, setBikesFetchFailed } from './actions';
import { handleActions } from 'redux-actions';
export default handleActions({
[setBikes]: (state, action) => ({
...state,
entities: action.payload.entities.bikes,
}),
[setBikesIsFetching]: (state, action) => ({
...state,
isFetching: action.payload,
}),
[setBikesFetched]: (state, action) => ({
...state,
fetched: action.payload,
}),
[setBikesFetchFailed]: (state, action) => ({
...state,
fetchFailed: {
message: action.payload
}
}),
}, { entities: {}, isFetching: false, fetched: false, fetchFailed: undefined });