mirror of https://github.com/fspc/workstand.git
Drew Larson
8 years ago
4 changed files with 8 additions and 19 deletions
@ -1,27 +1,17 @@ |
|||
import { setBike, setBikes, setBikesIsFetching, setBikesFetched } from './actions'; |
|||
import { setBikes, setBikesFetched, setBikesIsFetching } from './actions'; |
|||
import { handleActions } from 'redux-actions'; |
|||
|
|||
export default handleActions({ |
|||
[setBikes]: (state, action) => ({ |
|||
...state, |
|||
bikes: action.payload, |
|||
entities: action.payload.entities.bikes, |
|||
}), |
|||
[setBikesIsFetching]: (state, action) => ({ |
|||
...state, |
|||
bikes: { |
|||
...state.bikes, |
|||
isFetching: action.payload, |
|||
}, |
|||
}), |
|||
[setBikesFetched]: (state, action) => ({ |
|||
...state, |
|||
bikes: { |
|||
...state.bikes, |
|||
fetched: action.payload |
|||
} |
|||
fetched: action.payload, |
|||
}), |
|||
[setBike]: (state, action) => ({ |
|||
...state, |
|||
...action.payload, |
|||
}), |
|||
}, { bikes: [], bike: undefined }); |
|||
}, { entities: {}, isFetching: false, fetched: false }); |
|||
|
Loading…
Reference in new issue