jsketcher/modules/ui/mapContext.js
2018-06-22 00:31:33 -07:00

11 lines
No EOL
285 B
JavaScript

import React from 'react';
import context from 'context';
export default function mapContext(mapper) {
return function (Component) {
return function ContextMapper(props) {
let actions = mapper(context, props);
return <Component {...actions} {...props} />
}
}
}