mirror of
https://github.com/wassname/talk.git
synced 2026-07-09 16:26:30 +08:00
15 lines
499 B
JavaScript
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;
|
|
};
|