forked from shakacode/re-formality
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFormsWithFieldId.re
58 lines (49 loc) · 1.12 KB
/
FormsWithFieldId.re
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
module LoginForm = {
type field =
| Email
| Password
| RememberMe;
type state = {
email: string,
password: string,
rememberMe: bool,
};
type message = string;
type submissionError = unit;
let validators = [];
};
module LoginFormNoId = Formality.Make(LoginForm);
module LoginFormWithId =
Formality.MakeWithId({
include LoginForm;
module FieldId =
Id.MakeComparable({
type t = field;
let cmp = Pervasives.compare;
});
});
module LoginFormAsyncNoId =
Formality.Async.Make({
include LoginForm;
let debounceInterval = 100;
});
module LoginFormAsyncId =
Formality.Async.MakeWithId({
include LoginForm;
let debounceInterval = 100;
module FieldId =
Id.MakeComparable({
type t = field;
let cmp = Pervasives.compare;
});
});
module LoginFormAsyncBlurNoId = Formality.Async.MakeOnBlur(LoginForm);
module LoginFormAsyncBlurId =
Formality.Async.MakeOnBlurWithId({
include LoginForm;
module FieldId =
Id.MakeComparable({
type t = field;
let cmp = Pervasives.compare;
});
});