veliovgroup / flow-router

🚦 Carefully extended flow-router for Meteor
https://packosphere.com/ostrio/flow-router-extra
BSD 3-Clause "New" or "Revised" License
202 stars 29 forks source link

Group whileWaiting hook not triggering #30

Closed THETCR closed 6 years ago

THETCR commented 7 years ago

Hello,

The whileWaiting hook inside of a group is not firing as expected, the waitOn hook is though.

I'm using blaze with a yield to render a loading template inside of a body. If defined on the route itself it is working as expected.

Because i'm working on this project under an NDA, i cannot share any source code.

With friendly regards,

dr-dimitru commented 7 years ago

Hello @THETCR ,

Could you share pseudo-code which will show the basic view on how the group and route is defined? Like:

const group = FlowRouter.group({
  /* some opts here */
  whileWaiting() {
    console.log('This never logged'):
  }
});

group.route('path', {
  waitOn() {
    return ArrayOfSubs;
  }
});

The whileWaiting hook inside of a group is not firing as expected

What do you mean not firing as expected? Never called? Or called in wrong order?

dr-dimitru commented 7 years ago

@THETCR meanwhile I've checked the code. You're right whileWaiting isn't supported on group, at least yet.

THETCR commented 7 years ago

Thank you for the quick response.

I should have been more clear about it not being called and should have checked the source code if it is supported at all.

Are there are any plans on implementing this?

dr-dimitru commented 7 years ago

Are there are any plans on implementing this?

Now yes, marked as [enhancement]

I should have been more clear about it not being called and should have checked the source code if it is supported at all.

Actually docs says, what group should support same hooks as route

dr-dimitru commented 6 years ago

Hello @THETCR ,

Thank you for contribution, now all hooks and options supported on Group definition. Please keep in mind it's not "inheritable" options, except exit/enter triggers and waitOn hooks. So, defining whileWaiting on both group and route, on hook defined on route will be executed.

Published as v3.4.1, v3.4.2 fixes mistakenly duplicated exit/enter triggers and waitOn hooks.

Feel free to reopen it in case if the issue still persists on your end.