Closed MaxmaxmaximusGitHub closed 8 months ago
it doesn't suit me:
FlowRouter.wait();
WhenEverYourAppIsReady(() => {
FlowRouter.initialize();
});
i need like this
add: (page)->
@pages.push(page)
FlowRouter.route page.href,
name : page.name,
action: => @activate(page)
FlowRouter.update() # i need like this
return
@MaxmaxmaximusGitHub thank you for this suggestion. Adding a feature to initialize routes on the fly (during runtime) will require major changes. As right now we have stable and old codebase inherited from original package with many flaws, I'm keeping this feature open for next major v4 release
@MaxmaxmaximusGitHub looks like there's actually a trick to pull new routes dynamically, and it was used in our tests for a long time
After new routes passed into FlowRouter.route()
method:
const reloadRoutes = () => {
FlowRouter._initialized = false;
FlowRouter.initialize();
}
Trick from comment above should sole this issue
@MaxmaxmaximusGitHub Feel free to reopen it in case if the issue is still persists on your end.
I added a route 1 second after loading the page, how can I call the method.
Router.update ()
so that it checks for which route the current ur is suitable for?