You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

23 lines
671 B

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 });