(Component, mapValueToProps)
| 157 | * @returns {function} A shorthand factory function waiting for `val` and `defaultProps`. |
| 158 | */ |
| 159 | export function createShorthandFactory(Component, mapValueToProps) { |
| 160 | if (typeof Component !== 'function' && typeof Component !== 'string') { |
| 161 | throw new Error('createShorthandFactory() Component must be a string or function.') |
| 162 | } |
| 163 | |
| 164 | return (val, options) => createShorthand(Component, mapValueToProps, val, options) |
| 165 | } |
| 166 | |
| 167 | // ============================================================ |
| 168 | // HTML Factories |
no test coverage detected
searching dependent graphs…