Skip to content

Commit

Permalink
Update demo
Browse files Browse the repository at this point in the history
  • Loading branch information
fakenickels committed Jan 20, 2018
1 parent 3c94d4b commit 4418ce1
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions demo/src/app.re
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ module SignUpParams = {
password: string
};
type fields = [ | `email | `password | `confirmPassword];
let handleChange = (action, state) =>
switch action {
| (`email, value) => {...state, email: value}
| (`password, value) => {...state, password: value}
| (`confirmPassword, value) => {...state, confirmPassword: value}
};
let lens = [
(`email, (s) => s.email, (s, email) => { ...s, email }),
(`password, (s) => s.password, (s, password) => { ...s, password }),
(`confirmPassword, (s) => s.confirmPassword, (s, confirmPassword) => { ...s, confirmPassword }),
];
};

let defaults = (value, maybe) =>
Expand Down Expand Up @@ -44,11 +43,10 @@ let make = (~message, _children) => {
)
initialState={email: "", password: "", confirmPassword: ""}
schema=[
(`email, s => s.email, Email),
(`password, s => s.password, Required),
(`email, Email),
(`password, Required),
(
`confirmPassword,
s => s.confirmPassword,
Custom(
s =>
s.confirmPassword !== s.password ?
Expand Down

0 comments on commit 4418ce1

Please sign in to comment.