Files
talk/plugin-api/beta/client/factories/index.js
T
2018-01-11 20:00:34 -07:00

14 lines
501 B
JavaScript

import withSortOption from '../hocs/withSortOption';
import SortOption from '../components/SortOption';
/**
* A factory creating a sort option component.
* @param {string|function} label label to display, can be a callback for lazy evaluation.
* @param {Object} sort sort parameters
* @param {string} sort.sortBy
* @param {string} sort.sortOrder
* @return {Object} Component
*/
export const createSortOption = (label, sort) =>
withSortOption({ ...sort, label })(SortOption);