Files
talk/client/coral-framework/hocs/withFragments.js
T
Wyatt Johnson ae5da93730 linting fixes
2017-05-11 17:44:51 -06:00

15 lines
499 B
JavaScript

import React from 'react';
import {getDisplayName} from '../helpers/hoc';
// TODO: revisit `filtering` after https://github.com/apollographql/graphql-anywhere/issues/38.
export default (fragments) => (WrappedComponent) => {
class WithFragments extends React.Component {
render() {
return <WrappedComponent {...this.props} />;
}
}
WithFragments.fragments = fragments;
WithFragments.displayName = `WithFragments(${getDisplayName(WrappedComponent)})`;
return WithFragments;
};