You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

reducer.js 915B

12345678910111213141516171819202122232425262728
  1. import { ReducerRegistry } from '../base/redux';
  2. import { SET_DEVICE_SELECTION_POPUP_DATA } from './actionTypes';
  3. /**
  4. * Listen for actions which changes the state of the popup window for the device
  5. * selection.
  6. *
  7. * @param {Object} state - The Redux state of the feature
  8. * features/device-selection.
  9. * @param {Object} action - Action object.
  10. * @param {string} action.type - Type of action.
  11. * @param {Object} action.popupDialogData - Object that stores the current
  12. * Window object of the popup and the Transport instance. If no popup is shown
  13. * the value will be undefined.
  14. * @returns {Object}
  15. */
  16. ReducerRegistry.register('features/device-selection',
  17. (state = {}, action) => {
  18. if (action.type === SET_DEVICE_SELECTION_POPUP_DATA) {
  19. return {
  20. ...state,
  21. popupDialogData: action.popupDialogData
  22. };
  23. }
  24. return state;
  25. });