packages/flux-capacitor/lib/combineReducers.js
function combineReducers (reducers) {
  const databaseReducers = Object.keys(reducers)
    .map((collectionName) => {
      const reducer = reducers[ collectionName ]
      return createDatabaseReducer(reducer, collectionName)
    })

  return (database, event) => {
    const changesets = databaseReducers.map((reducer) => reducer(database, event))
    return combineChangesets(changesets)
  }
}
function combineReducers (reducers) {
  const databaseReducers = Object.keys(reducers)
    .map((collectionName) => {
      const reducer = reducers[ collectionName ]
      return createDatabaseReducer(reducer, collectionName)
    })

  return (database, event) => {
    const changesets = databaseReducers.map((reducer) => reducer(database, event))
    return combineChangesets(changesets)
  }
}
function combineReducers ( reducers ) { const databaseReducers = Object . keys ( reducers ) . map ( ( collectionName ) => { const reducer = reducers [ collectionName ] return createDatabaseReducer ( reducer , collectionName ) } ) return ( database , event ) => { const changesets = databaseReducers . map ( ( reducer ) => reducer ( database , event ) ) return combineChangesets ( changesets ) } }
Will combine multiple collection reducers to one database reducer.
Takes an object whose keys are collection names and whose values are
reducer functions.

The input reducers have the signature `(Collection, Event) => Changeset`,
the resulting combined reducer is `(Database, Event) => Changeset`.

@param {object} reducers   { [collectionName: string]: Function }
@return {Function}
Will combine multiple collection reducers to one database reducer . Takes an object whose keys are collection names and whose values are reducer functions .