Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8748719

Browse files
Update index.js
1 parent 234b6a3 commit 8748719

File tree

1 file changed

+2
-2
lines changed
  • src/components/functional-programming/composition/exercise

1 file changed

+2
-2
lines changed

‎src/components/functional-programming/composition/exercise/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { Form, Field } from "react-final-form";
33
import { required, mustBeEmail, atLeastFiveCharacters } from "./validators";
44

55
// Task 1, implement the composeValidators function
6-
// each validator has a value as input and returns false or the error message
6+
// each validator has a value as input and returns undefined or the error message
77
export const composeValidators = (...validators) => value =>
8-
validators.reduceRight((error, validator) => false,false);
8+
validators.reduceRight((error, validator) => undefined,undefined);
99

1010
// Task 2, you need to use the composeValidators so
1111
// - Email is validated with required and mustBeEmail

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /