xxs.js
function createUpdater(actionUpdates) {
  if (process.env.NODE_ENV !== 'production') {
    // Ensure that all values are functions
    Object.getOwnPropertySymbols(actionUpdates).concat(Object.keys(actionUpdates))
      .filter(k => typeof actionUpdates[k] !== 'function')
      .forEach(k => { throw new Error(`Expected a ((state, payload) => state) function for action '${k.toString()}' but found '${actionUpdates[k].toString()}'`); });
  }
  // If we have this action as a key, call it's value to update state, otherwise
  // pass through the state.
  return (state, action, payload) =>
    actionUpdates[action] ? actionUpdates[action](state, payload) : state;
}
function createUpdater(actionUpdates) {
  if (process.env.NODE_ENV !== 'production') {
    // Ensure that all values are functions
    Object.getOwnPropertySymbols(actionUpdates).concat(Object.keys(actionUpdates))
      .filter(k => typeof actionUpdates[k] !== 'function')
      .forEach(k => { throw new Error(`Expected a ((state, payload) => state) function for action '${k.toString()}' but found '${actionUpdates[k].toString()}'`); });
  }
  // If we have this action as a key, call it's value to update state, otherwise
  // pass through the state.
  return (state, action, payload) =>
    actionUpdates[action] ? actionUpdates[action](state, payload) : state;
}
function createUpdater ( actionUpdates ) { if ( process . env . NODE_ENV !== 'production' ) { // Ensure that all values are functions Object . getOwnPropertySymbols ( actionUpdates ) . concat ( Object . keys ( actionUpdates ) ) . filter ( k => typeof actionUpdates [ k ] !== 'function' ) . forEach ( k => { throw new Error ( ` ${ k . toString ( ) } ${ actionUpdates [ k ] . toString ( ) } ` ) ; } ) ; } // If we have this action as a key, call it's value to update state, otherwise // pass through the state. return ( state , action , payload ) => actionUpdates [ action ] ? actionUpdates [ action ] ( state , payload ) : state ; }
A helper to generate updater functions mapped by action
@param {object} actionUpdates An object with Actions (strings or symbols) as
keys and ((state, payload) => nextState) functions as values
@returns {function} An updater function ((state, action, payload) => nextState)
A helper to generate updater functions mapped by action