Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

reducer.js 977B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // @flow
  2. import { ReducerRegistry } from '../base/redux';
  3. import {
  4. ETHERPAD_INITIALIZED,
  5. SET_DOCUMENT_EDITING_STATUS
  6. } from './actionTypes';
  7. const DEFAULT_STATE = {
  8. /**
  9. * Whether or not Etherpad is currently open.
  10. *
  11. * @public
  12. * @type {boolean}
  13. */
  14. editing: false,
  15. /**
  16. * Whether or not Etherpad is ready to use.
  17. *
  18. * @public
  19. * @type {boolean}
  20. */
  21. initialized: false
  22. };
  23. /**
  24. * Reduces the Redux actions of the feature features/etherpad.
  25. */
  26. ReducerRegistry.register(
  27. 'features/etherpad',
  28. (state = DEFAULT_STATE, action) => {
  29. switch (action.type) {
  30. case ETHERPAD_INITIALIZED:
  31. return {
  32. ...state,
  33. initialized: true
  34. };
  35. case SET_DOCUMENT_EDITING_STATUS:
  36. return {
  37. ...state,
  38. editing: action.editing
  39. };
  40. default:
  41. return state;
  42. }
  43. });