meteor-event-horizon icon indicating copy to clipboard operation
meteor-event-horizon copied to clipboard

LoggedOut event does not fire

Open zhouzhuojie opened this issue 11 years ago • 0 comments

It works on the loggedIn event.

EventHorizon.fireWhenTrue('loggedIn',function(){
  return Meteor.userId() !== null;
});

EventHorizon.on('loggedIn',function(){
  console.log('The user just logged in.');
});

But when I changed it to

EventHorizon.fireWhenTrue('loggedOut',function(){
  return Meteor.userId()  === null;
});

EventHorizon.on('loggedOut',function(){
  console.log('The user just logged out.');
});

it fails to fire the event (login and logout multiple times). BTW, it is easy to check that

Meteor.userId() === null

in the console.

zhouzhuojie avatar Jun 22 '13 16:06 zhouzhuojie