Here is the thing. For example i’m on route A, and then i’m clicked on the link to route B.
But…before i’ll go to route B, i want to check something and if everything is good, only then proceed to route B.
Basically i want to stay on the same route during some operations(including async) within ‘onStop’ hook execution.
Now, as fast as onStop returns iron-router changing the route to route B, and i’m understand this is how the things work. On server i can use fibers/futurewait() But, how i can handle such situation on client in this case?
Yeah, i have one solution, migrating now to FlowRouter…still painful but starting to love it
If seriously - the only solution was - move the logic out of the IR…
Mate, it’s depends on what you trying to solve.
In my case i’ve put logic on template level, hide the data by default, check if i have a proper state and then show data or send user to another place.