tmeasday / meteor-router

MIT License
366 stars 76 forks source link

beforeRouting reactivity #88

Open zvictor opened 11 years ago

zvictor commented 11 years ago

It seems to me that beforeRouting should run encapsulated by Deps.nonreactive.

Trying to run the following code leads me to a infinite loop due to the reactivity:

Meteor.Router.beforeRouting = function() {
  var history = Session.get("history");
  history.push(window.location);
  Session.set("history", history);
};
littke commented 11 years ago

I've got similar problems with infinite loops.

(I'm only setting Sessions within beforeRouting though, which I'm guessing shouldn't be a reactive data source.)