Skip to content

Instantly share code, notes, and snippets.

@graphan
Created February 19, 2017 18:55
Show Gist options
  • Save graphan/ca1c6d21bc75153366bc0e39e189c683 to your computer and use it in GitHub Desktop.
Save graphan/ca1c6d21bc75153366bc0e39e189c683 to your computer and use it in GitHub Desktop.
Use of Recompose's branch for Loading Component
import { branch, renderComponent } from 'recompose';
const Loading = () => (
<div>Loading....</div>
);
export const withLoadingComponent = branch(
props => props.loading,
renderComponent(Loading),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment