jsketcher/modules/ui/mapContext.js

11 lines
No EOL
289 B
JavaScript

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