src/reducers/listenersReducer.js
function listenersById(state = {}, { type, path, payload }) {
  switch (type) {
    case actionTypes.SET_LISTENER:
      return {
        ...state,
        [payload.name]: {
          name: payload.name,
          path,
        },
      };
    case actionTypes.UNSET_LISTENER:
      return omit(state, [payload.name]);
    default:
      return state;
  }
}
function listenersById(state = {}, { type, path, payload }) {
  switch (type) {
    case actionTypes.SET_LISTENER:
      return {
        ...state,
        [payload.name]: {
          name: payload.name,
          path,
        },
      };
    case actionTypes.UNSET_LISTENER:
      return omit(state, [payload.name]);
    default:
      return state;
  }
}
function listenersById ( state = { } , { type , path , payload } ) { switch ( type ) { case actionTypes . SET_LISTENER : return { ... state , [ payload . name ] : { name : payload . name , path , } , } ; case actionTypes . UNSET_LISTENER : return omit ( state , [ payload . name ] ) ; default : return state ; } }
Reducer for listeners ids. Changed by `SET_LISTENER` and `UNSET_LISTENER`
actions.
@param  {Object} [state={}] - Current listenersById redux state
@param  {Object} action - Object containing the action that was dispatched
@param  {String} action.type - Type of action that was dispatched
@return {Object} listenersById state after reduction (used in listeners)
@private
Reducer for listeners ids . Changed by SET_LISTENER and UNSET_LISTENER actions .