Closed rodibozman closed 3 years ago
@clembu Would something like my last commit be better ?
Other interface to test:
make : ?update:(... React.E.t) -> ... -> ... React.S.t
Try to keep the interface similar to other widgets. May be return a record?
New interface is available (from last commit) Of all the interface I tried, this one is the most uniform with the rest of the toolkits already existant. and works really fine (I tried it on the graffiti tutorial).
They're was also a problem that we didn't even notice at first but is crucial in order to be able to use the color picker correctly, in the signature at first it was something like :
val make : ?a: [< Html_types.div_attrib > `Class ] Eliom_content.Html.attrib list ->
[> `Div ] Eliom_content.Html.D.elt * (int * float * float) Eliom_shared.React.S.t
when it should have been :
val make : ?a: [< Html_types.div_attrib > `Class ] Eliom_content.Html.attrib list -> unit ->
[> `Div ] Eliom_content.Html.D.elt * (int * float * float) Eliom_shared.React.S.t
Indeed they're was the unit type that was missing, without it, you can not call make
properly without giving the a
attribut.
That is why I added the unit type in the signature of make
in the last commit as well.
I have made a little bit of cleaning in the commits, the PR is ready to be merged !
I think the ocamlformat config file is missing
As you suggest it to me @balat, I have made cleaning in the history, I added the ocamlformat config file, and I reindented (once and for all) all the files with thoses commands :
> ocamlformat -i src/widgets/*.eliom
> ocamlformat -i src/widgets/*.eliomi
Now we can all work with the same "save format" with all the current files.
@balat Changes are made after our conversation, the PR is ready to be merged.
@balat Correction for the few mistakes are done, the modifications are at the correct commit now 👍🏼
…to set the signal in addition to its value.
In the function
make
of the fileot_color_picker.eliom
(also see the.eliomi
) we return the entirecp_sig
and not just thefst
attribute of thecp_sig
in order to be able to re-set it if we want to.(I don't know if the reindent of the ocaml formatter is an issue but let me know I will reindent just like the previous way if needed)