UNPKG

google-map-react

Version:

isomorphic google map react component, allows render react components on the google map

30 lines (25 loc) 689 B
import { wrapDisplayName } from 'recompose'; const createHelper = ( func, helperName, setDisplayName = true, noArgs = false ) => { if (process.env.NODE_ENV !== 'production' && setDisplayName) { if (noArgs) { return BaseComponent => { const Component = func(BaseComponent); Component.displayName = wrapDisplayName(BaseComponent, helperName); return Component; }; } return (...args) => BaseComponent => { const Component = func(...args)(BaseComponent); Component.displayName = wrapDisplayName(BaseComponent, helperName); return Component; }; } return func; }; export default createHelper;