-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include optional params in fetch function #27
Comments
Hmm, yeah. The original objective for this was to create a set of bindings that were as thin as possible while still being sound, and then have others build libraries on top of that, like re:fetch. But since that hasn't happened and people just use this instead despite the horrible UX, we might as well add some convenience like this. Now that |
OK, in that case I'd like to propose making a new |
Sounds great. Go for it! 😄 |
Talking about I feel as this is a big part, and from lurking it looks like there's some effort going on in a few different places (apart from Refetch): https://github.com/anuragsoni/fetch/ |
I've come to believe that JavaScript's 'options object' function parameter pattern is a poor-man's optional parameter implementation. The
fetch
function is a perfect example of this. I would like to wrap it in a function that actually accepts optional parameters and converts them into therequestInit
type. This would be a backward-compatible change and look like this:Now callers will be able to use
fetch ~method_:Post "http://example.com"
, instead offetchWithInit "http://example.com" (RequestInit.make ~method_:Post ())
.The text was updated successfully, but these errors were encountered: