mirror of https://github.com/fspc/workstand.git
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.
28 lines
636 B
28 lines
636 B
8 years ago
|
import { setBike, setBikes, setBikesIsFetching, setBikesFetched } from './actions';
|
||
|
import { handleActions } from 'redux-actions';
|
||
|
|
||
|
export default handleActions({
|
||
|
[setBikes]: (state, action) => ({
|
||
|
...state,
|
||
|
bikes: action.payload,
|
||
|
}),
|
||
|
[setBikesIsFetching]: (state, action) => ({
|
||
|
...state,
|
||
|
bikes: {
|
||
|
...state.bikes,
|
||
|
isFetching: action.payload,
|
||
|
},
|
||
|
}),
|
||
|
[setBikesFetched]: (state, action) => ({
|
||
|
...state,
|
||
|
bikes: {
|
||
|
...state.bikes,
|
||
|
fetched: action.payload
|
||
|
}
|
||
|
}),
|
||
|
[setBike]: (state, action) => ({
|
||
|
...state,
|
||
|
...action.payload,
|
||
|
}),
|
||
|
}, { bikes: [], bike: undefined });
|