{"action":"created","issue":{"url":"https://api.github.com/repos/EngineeringMode/Grapnel.js/issues/26","labels_url":"https://api.github.com/repos/EngineeringMode/Grapnel.js/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/EngineeringMode/Grapnel.js/issues/26/comments","events_url":"https://api.github.com/repos/EngineeringMode/Grapnel.js/issues/26/events","html_url":"https://github.com/EngineeringMode/Grapnel.js/issues/26","id":57609625,"number":26,"title":"Calling router.get() on the same route more than once","user":{"login":"PanzerKunst","id":1530772,"avatar_url":"https://avatars.githubusercontent.com/u/1530772?v=3","gravatar_id":"","url":"https://api.github.com/users/PanzerKunst","html_url":"https://github.com/PanzerKunst","followers_url":"https://api.github.com/users/PanzerKunst/followers","following_url":"https://api.github.com/users/PanzerKunst/following{/other_user}","gists_url":"https://api.github.com/users/PanzerKunst/gists{/gist_id}","starred_url":"https://api.github.com/users/PanzerKunst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PanzerKunst/subscriptions","organizations_url":"https://api.github.com/users/PanzerKunst/orgs","repos_url":"https://api.github.com/users/PanzerKunst/repos","events_url":"https://api.github.com/users/PanzerKunst/events{/privacy}","received_events_url":"https://api.github.com/users/PanzerKunst/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-13T15:11:43Z","updated_at":"2015-02-17T22:44:35Z","closed_at":"2015-02-17T22:44:35Z","body":"Hi,\r\n\r\nI noticed that calling `router.get` twice on the same route made that the callback function is executed twice once that route is accessed. What would be ideal, is that when calling `get` on an route already defined in the router, it would replace the existing callback by the new one.\r\n\r\nIf that is not possible, as an alternative, is there a way to check if a route is already defined in the router, in order then to avoid re-executing `get` on that route?"},"comment":{"url":"https://api.github.com/repos/EngineeringMode/Grapnel.js/issues/comments/74771486","html_url":"https://github.com/EngineeringMode/Grapnel.js/issues/26#issuecomment-74771486","issue_url":"https://api.github.com/repos/EngineeringMode/Grapnel.js/issues/26","id":74771486,"user":{"login":"EngineeringMode","id":1062622,"avatar_url":"https://avatars.githubusercontent.com/u/1062622?v=3","gravatar_id":"","url":"https://api.github.com/users/EngineeringMode","html_url":"https://github.com/EngineeringMode","followers_url":"https://api.github.com/users/EngineeringMode/followers","following_url":"https://api.github.com/users/EngineeringMode/following{/other_user}","gists_url":"https://api.github.com/users/EngineeringMode/gists{/gist_id}","starred_url":"https://api.github.com/users/EngineeringMode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EngineeringMode/subscriptions","organizations_url":"https://api.github.com/users/EngineeringMode/orgs","repos_url":"https://api.github.com/users/EngineeringMode/repos","events_url":"https://api.github.com/users/EngineeringMode/events{/privacy}","received_events_url":"https://api.github.com/users/EngineeringMode/received_events","type":"User","site_admin":false},"created_at":"2015-02-17T22:44:35Z","updated_at":"2015-02-17T22:44:35Z","body":"@PanzerKunst Traditional functionality of a router suggests that when a callback is assigned to a route, that callback must be called when the router matches the route(s). So if multiple callbacks are defined on the same route, all of those callbacks must be ran. However, you can prevent any unwanted callbacks from being called by using `event.stopPropagation()`."}}