Reputation: 233
I am using Meteor and FlowRouter, and I would like to force my page to reload when I change the url (or alternatively one of the parameters of my route). Would anyone know a way to do so?
There has been a few debates over this, but I haven't found a satisfactory answer yet.
PS:
I know one suggested method is to put FlowRouter.watchPathChange()
inside a Tracker.autorun()
but this doesn't seem very satisfactory for what I want to do (changing css classes based on the route parameter), plus I'd like to have the effect of having a page reload.
Upvotes: 1
Views: 581
Reputation: 546
FlowRouter has a few reactive APIs for accessing the URL state very efficiently:
- FlowRouter.getParam("paramName")
- FlowRouter.getQueryParam("queryParamName")
- FlowRouter.getRouteName()
Putting FlowRouter.watchPathChange()
inside a Tracker.autorun()
is not the only option. You can put in autorun some of functions listed above.
Upvotes: 1