Skip to content

Commit

Permalink
feat(pageLayout): apply basic strict typing
Browse files Browse the repository at this point in the history
  • Loading branch information
aneurysmjs committed May 30, 2019
1 parent c030db2 commit 737c5b0
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/app/components/hocs/pageLayout.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import Layout from '@/components/core/Layout/Layout';
// @flow strict
import type { AbstractComponent } from 'react';

function pageLayout<Config: {}>(
Component: AbstractComponent<Config>
): AbstractComponent<Config> {
return Component;
}

function withSubscription(WrappedComponent) {
// ...and returns another component...
return class extends React.Component {

render() {
// ... and renders the wrapped component with the fresh data!
// Notice that we pass through any additional props
return <WrappedComponent data={this.state.data} {...this.props} />;
}
};
}
export default pageLayout;

0 comments on commit 737c5b0

Please sign in to comment.