Skip to content

Commit 5c7a085

Browse files
author
Vlad Balin
committed
Merge remote-tracking branch 'refs/remotes/origin/develop'
2 parents 4329501 + 7296827 commit 5c7a085

File tree

16 files changed

+685
-437
lines changed

16 files changed

+685
-437
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Features:
5151
- Added "Users List" application example.
5252
- `link.toggle` is _removed_. Use `link.update( x => !x )` instead.
5353
- `<NumberInput/>` tag with input rejection for numbers.
54+
- Validator functions for `link.check` may contain default `error` message.
5455

5556
# Installation
5657

@@ -294,6 +295,14 @@ but returns `undefined` and leads to the proper purely functional update of the
294295

295296
Evaluate given condition for the current link value, and assign
296297
given error object to the `link.error` when it fails. There are no restriction on the error object shape and type.
298+
299+
It's possible to assign default error message to the validator function. `tags.jsx` provides `isRequired` and `isEmail`
300+
generic validator functions as an examples. Excerpt from `tags.jsx`:
301+
302+
```jsx
303+
export const isRequired = x => x != null && x !== '';
304+
isRequired.error = 'Required';
305+
```
297306

298307
Checks can be chained. In this case, the first check which fails will leave its error in the link.
299308

0 commit comments

Comments
 (0)