page.js 502B

123456789101112131415161718192021222324252627
  1. import { ADD, MINUS } from '../constants/user'
  2. // landlord: 'landlord',
  3. // customer:'customer'
  4. const INITIAL_STATE = {
  5. link:'index',
  6. id:String,
  7. params:Object
  8. }
  9. export default function counter (state = INITIAL_STATE, action) {
  10. switch (action.type) {
  11. case ADD:
  12. return {
  13. ...state,
  14. num: state.num + 1
  15. }
  16. case MINUS:
  17. return {
  18. ...state,
  19. num: state.num - 1
  20. }
  21. default:
  22. return state
  23. }
  24. }