TheSpyder / rescript-webapi

ReScript bindings to the DOM and other Web APIs
http://tinymce.github.io/rescript-webapi/api/Webapi/
Other
149 stars 36 forks source link

Add new binding to Webapi.FormData to create it from form elements. #108

Closed mvaled closed 1 year ago

mvaled commented 1 year ago

@TheSpyder I've the requested changes.

TheSpyder commented 1 year ago

Ah, I forgot to actually compile before I merged. FormData already depends on HtmlFormElement.

FAILED: dependency cycle: src/Webapi/Dom/Webapi__Dom__HtmlFormElement.cmj -> src/Webapi/Webapi__FormData.cmj -> src/Webapi/Dom/Webapi__Dom__HtmlFormElement.cmj.

hmmmmmm that's a tricky one.

TheSpyder commented 1 year ago

The name is a bit weird but this function already exists:

https://github.com/tinymce/rescript-webapi/blob/9f616918907ea67b29a4174fd851be0caea8e617/src/Webapi/Dom/Webapi__Dom__HtmlFormElement.res#L39

I'll revert this for now, and add a note to FormData explaining how to make one from a form element. Maybe we can move the function to FormData in v2.

TheSpyder commented 1 year ago

Published as 0.7.0