tom-sherman / rescript-remix

MIT License
30 stars 5 forks source link

Add response options to `json` and `redirect` helper bindings #7

Open tom-sherman opened 2 years ago

tom-sherman commented 2 years ago

https://remix.run/docs/en/v1/api/remix#http-helpers

Example:

// We can bikeshed the `withResponse` suffix
let jsonWithResponse: ({..}, Webapi.Fetch.ResponseInit.t) => Webapi.Fetch.Response.t
let redirectWithResponse: (string, Webapi.Fetch.ResponseInit.t) => Webapi.Fetch.Response.t
tom-sherman commented 2 years ago

This is currently blocked by the lack of ResponseInit.make and/or Response.make functions in rescript-webapi

Raised here https://github.com/tinymce/rescript-webapi/issues/63