{"action":"created","issue":{"url":"https://api.github.com/repos/dekujs/deku/issues/154","labels_url":"https://api.github.com/repos/dekujs/deku/issues/154/labels{/name}","comments_url":"https://api.github.com/repos/dekujs/deku/issues/154/comments","events_url":"https://api.github.com/repos/dekujs/deku/issues/154/events","html_url":"https://github.com/dekujs/deku/issues/154","id":83157840,"number":154,"title":"custom props validator","user":{"login":"joshrtay","id":132602,"avatar_url":"https://avatars.githubusercontent.com/u/132602?v=3","gravatar_id":"","url":"https://api.github.com/users/joshrtay","html_url":"https://github.com/joshrtay","followers_url":"https://api.github.com/users/joshrtay/followers","following_url":"https://api.github.com/users/joshrtay/following{/other_user}","gists_url":"https://api.github.com/users/joshrtay/gists{/gist_id}","starred_url":"https://api.github.com/users/joshrtay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshrtay/subscriptions","organizations_url":"https://api.github.com/users/joshrtay/orgs","repos_url":"https://api.github.com/users/joshrtay/repos","events_url":"https://api.github.com/users/joshrtay/events{/privacy}","received_events_url":"https://api.github.com/users/joshrtay/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dekujs/deku/labels/feature%20request","name":"feature request","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-05-31T18:49:39Z","updated_at":"2015-06-03T21:25:43Z","closed_at":null,"body":"It would be nice to be able to use custom props validators. Would you guys be open to allowing users to override the built in validator by passing a validator function to deku. It could be something like this:\r\n\r\n```js\r\nvar validator = require('is-my-json-valid');\r\napp.option('validateProps', function (props, rules) {\r\n  var validate = validator({ type: 'object', properties: rules});\r\n  if (!validate(props)) {\r\n   var err = validate.errors[0];\r\n   throw new Error(err.message + ':' + err.field);\r\n  }\r\n});\r\n``` "},"comment":{"url":"https://api.github.com/repos/dekujs/deku/issues/comments/108619957","html_url":"https://github.com/dekujs/deku/issues/154#issuecomment-108619957","issue_url":"https://api.github.com/repos/dekujs/deku/issues/154","id":108619957,"user":{"login":"anthonyshort","id":36125,"avatar_url":"https://avatars.githubusercontent.com/u/36125?v=3","gravatar_id":"","url":"https://api.github.com/users/anthonyshort","html_url":"https://github.com/anthonyshort","followers_url":"https://api.github.com/users/anthonyshort/followers","following_url":"https://api.github.com/users/anthonyshort/following{/other_user}","gists_url":"https://api.github.com/users/anthonyshort/gists{/gist_id}","starred_url":"https://api.github.com/users/anthonyshort/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anthonyshort/subscriptions","organizations_url":"https://api.github.com/users/anthonyshort/orgs","repos_url":"https://api.github.com/users/anthonyshort/repos","events_url":"https://api.github.com/users/anthonyshort/events{/privacy}","received_events_url":"https://api.github.com/users/anthonyshort/received_events","type":"User","site_admin":false},"created_at":"2015-06-03T21:25:43Z","updated_at":"2015-06-03T21:25:43Z","body":"Yup that sounds like a good idea! We'd just need to expose a hook in the renderer whenever props change for a component. We could provide a basic one as a plugin,\r\n\r\n```js\r\nimport {validate} from 'dekujs/validate'\r\napp.use(validate())\r\n```"}}