Closed yihangho closed 5 years ago
It seems that the signatures for Headers.append & .delete are wrong. Previously, there were:
external append : string -> string = "" [@@bs.send.pipe: t] external delete : string = "" [@@bs.send.pipe: t]
However, their usage (in JS) should be
headers.append("Content-Type", "application/json"); headers.delete("Content-Type");
So I think there should be an extra -> unit for both of them.
-> unit
I've tested my fix with the following (in Reason):
let headers = Fetch.Headers.make; Fetch.Headers.append("X-My-Header", "value", headers); Fetch.Headers.delete("X-My-Header", headers);
and the corresponding generated JS (sans extra spacing for readability):
'use strict'; var headers = new Headers(); headers.append("X-My-Header", "value"); headers.delete("X-My-Header");
It seems that the signatures for Headers.append & .delete are wrong. Previously, there were:
However, their usage (in JS) should be
So I think there should be an extra
-> unit
for both of them.I've tested my fix with the following (in Reason):
and the corresponding generated JS (sans extra spacing for readability):