Skip to content

Commit 67ab137

Browse files
committed
Refactor useWatchParamsOfInputs type definition
* Change control field from optional to required in useWatchParamsOfInputs type.
1 parent 27245da commit 67ab137

4 files changed

Lines changed: 13 additions & 15 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# v0.0.10(unreleased)
22

3-
3+
- Change control field from optional to required in useWatchParamsOfInputs type
44

55
# v0.0.9
66

doc/transformation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ module FormProviderOfInputs = {
129129
//useWatch
130130
type useWatchParamsOfInputs = {
131131
name: variantOfInputs,
132-
control: controlOfInputs=?,
132+
control: controlOfInputs,
133133
defaultValue: valueOfInputs=?,
134134
disabled: bool=?,
135135
exact: bool=?,

src/ppx/signature.ml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ let map_type_decl
862862

863863
(* type useWatchParamsOfInputs = {
864864
name: variantOfInputs,
865-
control: controlOfInputs=?,
865+
control: controlOfInputs,
866866
defaultValue: valueOfInputs=?,
867867
disabled: bool=?,
868868
exact: bool=?,
@@ -880,8 +880,7 @@ let map_type_decl
880880
(Typ.constr
881881
(lid @@ "variantOf" ^ capitalize record_name)
882882
[]);
883-
Type.field ~attrs:[ attr_optional ] ~mut:Immutable
884-
(mknoloc "control")
883+
Type.field ~mut:Immutable (mknoloc "control")
885884
(Typ.constr ~attrs:[ attr_named_arg ]
886885
(lid @@ "controlOf" ^ capitalize record_name)
887886
[]);

src/ppx/structure.ml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ let map_type_decl
861861

862862
(* type useWatchParamsOfInputs = {
863863
name: variantOfInputs,
864-
control: controlOfInputs=?,
864+
control: controlOfInputs,
865865
defaultValue: valuesOfInputs=?,
866866
disabled: bool=?,
867867
exact: bool=?,
@@ -879,8 +879,7 @@ let map_type_decl
879879
(Typ.constr
880880
(lid @@ "variantOf" ^ capitalize record_name)
881881
[]);
882-
Type.field ~attrs:[ attr_optional ] ~mut:Immutable
883-
(mknoloc "control")
882+
Type.field ~mut:Immutable (mknoloc "control")
884883
(Typ.constr ~attrs:[ attr_named_arg ]
885884
(lid @@ "controlOf" ^ capitalize record_name)
886885
[]);
@@ -1204,7 +1203,7 @@ let map_type_decl
12041203
.string
12051204
~quotation_delimiter:
12061205
"*j"
1207-
"")
1206+
"")
12081207
);
12091208
( Nolabel,
12101209
Exp
@@ -1225,8 +1224,8 @@ let map_type_decl
12251224
(
12261225
Typ
12271226
.constr
1228-
1229-
(lid
1227+
(
1228+
lid
12301229
"string")
12311230
[])
12321231
);
@@ -1250,9 +1249,8 @@ let map_type_decl
12501249
~attrs:
12511250
[
12521251
Attr.mk
1253-
1254-
(mknoloc
1255-
"res.uapp")
1252+
(mknoloc
1253+
"res.uapp")
12561254
(PStr
12571255
[]);
12581256
]
@@ -1285,7 +1283,8 @@ let map_type_decl
12851283
]
12861284
(Const.string
12871285
~quotation_delimiter:
1288-
"*j" ".") );
1286+
"*j"
1287+
".") );
12891288
] );
12901289
( Nolabel,
12911290
Exp.coerce

0 commit comments

Comments
 (0)