{"action":"closed","issue":{"url":"https://api.github.com/repos/guillaumepotier/Parsley.js/issues/865","labels_url":"https://api.github.com/repos/guillaumepotier/Parsley.js/issues/865/labels{/name}","comments_url":"https://api.github.com/repos/guillaumepotier/Parsley.js/issues/865/comments","events_url":"https://api.github.com/repos/guillaumepotier/Parsley.js/issues/865/events","html_url":"https://github.com/guillaumepotier/Parsley.js/issues/865","id":60451126,"number":865,"title":"Isn't it better that addAsyncValidator could accept function as fourth parameters (options)","user":{"login":"vannleonheart","id":1867595,"avatar_url":"https://avatars.githubusercontent.com/u/1867595?v=3","gravatar_id":"","url":"https://api.github.com/users/vannleonheart","html_url":"https://github.com/vannleonheart","followers_url":"https://api.github.com/users/vannleonheart/followers","following_url":"https://api.github.com/users/vannleonheart/following{/other_user}","gists_url":"https://api.github.com/users/vannleonheart/gists{/gist_id}","starred_url":"https://api.github.com/users/vannleonheart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vannleonheart/subscriptions","organizations_url":"https://api.github.com/users/vannleonheart/orgs","repos_url":"https://api.github.com/users/vannleonheart/repos","events_url":"https://api.github.com/users/vannleonheart/events{/privacy}","received_events_url":"https://api.github.com/users/vannleonheart/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-10T04:57:46Z","updated_at":"2015-09-19T17:42:02Z","closed_at":"2015-09-19T17:42:02Z","body":"When add new async validator, isn't it better if it could accept function that return object as fourth parameter (options parameter). I think it will give us more capability when adding options especially if we need to match it with specific condition.\r\n\r\n`app.find( \".parsleyForm\" ).parsley()\r\n.addAsyncValidator( \"customValidator\", function ( xhr ) {\r\n  return 404 === xhr.status;\r\n}, \"http://mysite.com/api/users\", function ( $instance ) {\r\n  return {\r\n    data: {\r\n      filters: {\r\n        email: $instance.$element.val()\r\n      }\r\n    }\r\n  };\r\n});`"}}