src/modules/reduction.js
function result(collection) {
  switch (true) {
    case isImplemented(collection, 'result'):
      return collection[p.result];
    case isString(collection):
    case isArray(collection):
    case isObject(collection):
    case isFunction(collection):
      return value => value;
    default:
      return null;
  }
}
function result(collection) {
  switch (true) {
    case isImplemented(collection, 'result'):
      return collection[p.result];
    case isString(collection):
    case isArray(collection):
    case isObject(collection):
    case isFunction(collection):
      return value => value;
    default:
      return null;
  }
}
function result ( collection ) { switch ( true ) { case isImplemented ( collection , 'result' ) : return collection [ p . result ] ; case isString ( collection ) : case isArray ( collection ) : case isObject ( collection ) : case isFunction ( collection ) : return value => value ; default : return null ; } }
Returns a result function for a collection. This is a function that performs any final processing that should be done
on the result of a reduction. If the collection doesn't support reduction, `null` is returned.

In order to support the conversion of functions into reducers, function support is also provided.

@private

@param {*} collection A collection to create a step function for. This can be anything that supports the ES2015
iteration protocol, a plain object, a pre-ES2015 string or array, or a function.
@return {module:xduce~result} A function that, when given a reduced collection, produces the final output. If the
provided collection is not iterable, `null` will be returned.
Returns a result function for a collection . This is a function that performs any final processing that should be done on the result of a reduction . If the collection doesn t support reduction null is returned .