UNPKG

react-collection-helpers

Version:
21 lines (18 loc) 1.65 kB
import { MODULE_NAME } from '../constants'; export var invalidTypeSuppliedAsPredicate = function invalidTypeSuppliedAsPredicate(_ref) { var type = _ref.type, predicate = _ref.predicate, component = _ref.component; return '\n>> Error, via ' + MODULE_NAME + ' <<\n\nYou supplied an invalid predicate.\n\nPredicates must either be an object or a function. You provided the following ' + type + ': ' + predicate + '.\n\nCheck the render method of <' + component + '>.\n'; }; export var invalidTypeSuppliedAsComparator = function invalidTypeSuppliedAsComparator(_ref2) { var type = _ref2.type, comparator = _ref2.comparator, component = _ref2.component; return '\n>> Error, via ' + MODULE_NAME + ' <<\n\nYou supplied an invalid comparator.\n\nPredicates must either be a string or a function. You provided the following ' + type + ': ' + comparator + '.\n\nCheck the render method of <' + component + '>.\n'; }; export var unknownChildPassedToCollectionHelper = function unknownChildPassedToCollectionHelper(_ref3) { var children = _ref3.children, parentComponent = _ref3.parentComponent; return '\n>> Error, via ' + MODULE_NAME + ' <<\n\nYou supplied an unknown child to a Collection Helper.\n\nCollection Helpers take very specific children. Please supply 1 of the 2 following types:\n\n1. a function:\n\n <Filter>\n {item => <div>{item.name}</div>}\n </Filter>\n\n2. another Collection Helper:\n\n <Filter>\n <Sort>\n {item => <div>{item.name}</div>}\n </Sort>\n </Filter>\n\nYou supplied: ' + children + '.\n\nCheck the render method of <' + parentComponent + '>.\n'; };