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.

24 lines
671 B

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