Skip to content

Instantly share code, notes, and snippets.

@alexbeletsky
Created November 17, 2017 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexbeletsky/bc9329dd6c3179820ea0c8b43bb1422e to your computer and use it in GitHub Desktop.
Save alexbeletsky/bc9329dd6c3179820ea0c8b43bb1422e to your computer and use it in GitHub Desktop.
const CheckedWelcome = composeComponents(
Welcome,
[
(c) => checkBoarded(c, { withValue: true, redirectTo: '/app/dashboard' }),
(c) => requiresAuth(c)
]
);
const CheckApp = composeComponents(
App,
[
(c) => checkBoarded(c, { withValue: false, redirectTo: '/welcome-on-board'}),
(c) => requiresAuth(c),
(c) => requiresSmth(c, { options: {} })
]
);
const routes = (
<Route path="">
// much more clean route definition
<Route path="/welcome-on-board" component={CheckedWelcome} />
<Route path="/app" component={CheckedApp}>
// ...
</Route>
</Route>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment