Skip to content

Commit

Permalink
(docs) Improve README with clarification on callbacks (#636)
Browse files Browse the repository at this point in the history
Without cluttering up the README.md and keeping it as minimal as possible, added clarification that the callback is executed synchronously. This matches what is included in API.md and makes it clearer to new users without having to dig through the API docs or archived issues (#636) that there is no performance benefit of passing in a callback to validate, as typical node users would expect when such a callback option is provided.
  • Loading branch information
AaronHarris committed Feb 26, 2017
1 parent d09e342 commit 90da318
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const schema = Joi.object().keys({
const result = Joi.validate({ username: 'abc', birthyear: 1994 }, schema);
// result.error === null -> valid

// You can also pass a callback which will be called with the validation result.
// You can also pass a callback which will be called synchronously with the validation result.
Joi.validate({ username: 'abc', birthyear: 1994 }, schema, function (err, value) { }); // err === null -> valid

```
Expand Down

0 comments on commit 90da318

Please sign in to comment.