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.