Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I reload the current iron:router route?

If I'm currently at /foo, Router.go '/foo' does nothing. I would like /foo's action hooks and rendering to be redone. I know I could make a dependency, mention it in an action hook, and invalidate it when I need to reload, I'm just hoping there's a Router.* api I can use, because that would be cleaner.

like image 279
Loren Avatar asked Feb 05 '15 07:02

Loren


1 Answers

This adds a function Router.rerun() that works:

login_dep = new Tracker.Dependency

Router.rerun = ->
  login_dep.changed()

Router.configure
  onBeforeAction: ->
    login_dep.depend()
    ...
like image 53
Loren Avatar answered Oct 22 '22 21:10

Loren