Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use goto (or switchTo) inside the routing match #2

Open
ajcamilo opened this issue Sep 28, 2016 · 0 comments
Open

Use goto (or switchTo) inside the routing match #2

ajcamilo opened this issue Sep 28, 2016 · 0 comments

Comments

@ajcamilo
Copy link

How can I use the goto inside the current definition?

I have the following route:

private lazy val current: Rx[Frag] = Rx {
  if(authorized()){
    router.current() match {
      case HomeScreen => HomePage()
      case AboutScreen => AboutPage()
      case _ => router.goto(HomeScreen)
    }
  } else {
     router.current() match {
       case LoginScreen => LoginPage()
       case _ => router.goto(LoginScreen)
    }
  }
}

This doesn't work, current appears to be empty after the goto.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant