Skip to content

Instantly share code, notes, and snippets.

@Shuumatsu
Created August 29, 2018 03:27
Show Gist options
  • Save Shuumatsu/274b75acd50c9fd6ee63c32f7401c068 to your computer and use it in GitHub Desktop.
Save Shuumatsu/274b75acd50c9fd6ee63c32f7401c068 to your computer and use it in GitHub Desktop.
import { STATUSES } from '@/constants'
import withUserInformation from '@/hocs/withUserInformation'
import { identity } from 'ramda'
import { branch, compose, renderComponent } from 'recompose'
import LoginPage from '../routes/login'
const privateComponent = branch(
({ loginStatus }) => loginStatus === STATUSES.SUCCESSED,
identity,
renderComponent(LoginPage)
)
export default compose(
withUserInformation,
privateComponent
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment