RouteReducer.js 328 B

123456789101112
  1. export const RouteReducer = (state={}, { type, match }) => {
  2. if (type === 'ROUTE_ADD') {
  3. return match
  4. }
  5. if (type === 'ROUTE_CLEAR'){
  6. return {}
  7. }
  8. return state
  9. }
  10. export const actionMyRoute = match => ({type: 'ROUTE_ADD', match})
  11. export const actionMyRouteClear = () => ({type: 'ROUTE_CLEAR'})