baseprime / grapnel

The smallest JavaScript router with named parameters, HTML5 pushState, and middleware support
http://grapnel.js.org
467 stars 40 forks source link

stop propagation works only if there is no middleware #51

Closed arisAlexis closed 8 years ago

arisAlexis commented 8 years ago
this._router.add('posts/add',this._auth,(req,event)=> {
event.stopPropagation();
    new PostNewView();
  });
this._router.add('posts/:postId',(req)=>new SinglePostView({postId:req.params.postId}));

this works as expected only if this._auth is removed

baseprime commented 8 years ago

@arisAlexis this._auth is already ran before the middleware that you're defining (the one with the stopPropagation() call) has already happened.