{"action":"opened","issue":{"url":"https://api.github.com/repos/hapijs/discuss/issues/401","repository_url":"https://api.github.com/repos/hapijs/discuss","labels_url":"https://api.github.com/repos/hapijs/discuss/issues/401/labels{/name}","comments_url":"https://api.github.com/repos/hapijs/discuss/issues/401/comments","events_url":"https://api.github.com/repos/hapijs/discuss/issues/401/events","html_url":"https://github.com/hapijs/discuss/issues/401","id":188385656,"number":401,"title":"Patterns for DRYer logic within Handlers...","user":{"login":"ebgranger","id":4431706,"avatar_url":"https://avatars.githubusercontent.com/u/4431706?v=3","gravatar_id":"","url":"https://api.github.com/users/ebgranger","html_url":"https://github.com/ebgranger","followers_url":"https://api.github.com/users/ebgranger/followers","following_url":"https://api.github.com/users/ebgranger/following{/other_user}","gists_url":"https://api.github.com/users/ebgranger/gists{/gist_id}","starred_url":"https://api.github.com/users/ebgranger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ebgranger/subscriptions","organizations_url":"https://api.github.com/users/ebgranger/orgs","repos_url":"https://api.github.com/users/ebgranger/repos","events_url":"https://api.github.com/users/ebgranger/events{/privacy}","received_events_url":"https://api.github.com/users/ebgranger/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-10T00:08:12Z","updated_at":"2016-11-10T00:08:12Z","closed_at":null,"body":"Hey Guys,\r\n\r\nI hope this question isn't too broad. On a current project I'm on, I'm noticing general patterns within our handlers as we set up our context to be passed to the views. Pulling data from cookies, extending context with defaults, checking for query params, etc.\r\n\r\nI want to maintain the balance between DAMP and DRY code, but I don't see the value in keeping so many identical blocks of code in each handler that could be delegated to a utility. \r\n\r\nI'm looking to gleam some fundamentals from you all as well as figure out the \"hapi-est\" way to accomplish this. \r\n\r\nRead through this [issue](https://github.com/hapijs/discuss/issues/66), but unsure if it will be the best route to take. \r\n\r\nIs developing certain utilities plus the pre handler the key to getting my projects route handlers a little more succinct and maintainable? "}}
{"actor":{"display_login":"ebgranger"}}