app.js 380B

1234567891011121314151617181920
  1. import { APP_LIST } from '../action-creator.sync.js'
  2. export default function app (state = {
  3. name: '',
  4. componentLeft: '',
  5. componentRight: '',
  6. customClass: '',
  7. icon: ''
  8. }, action) {
  9. switch (action.type) {
  10. case `Set/${APP_LIST}`:
  11. const rez = {}
  12. action.appList.forEach(app => (rez[app.name] = app))
  13. return rez
  14. default:
  15. return state
  16. }
  17. }