-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Change setSearch to handle SearchParams.t #176
Change setSearch to handle SearchParams.t #176
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiny nit, but overall looks perfect
packages/url/native/URL.re
Outdated
@@ -214,8 +214,12 @@ let search = url => { | |||
| _ => Some("?" ++ Uri.encoded_of_query(~scheme, query)) | |||
}; | |||
}; | |||
let setSearch = (t, string) => { | |||
Uri.with_query(t, Uri.query_of_encoded(string)); | |||
let setSearchString = (t, searchString) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rename this to setSearchAsString
packages/url/native/URL.re
Outdated
let queryString = SearchParams.toString(searchParams); | ||
setSearchString(t, queryString); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to transform toString here, Uri.with_query should do the job, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point
7929444
to
c3303c8
Compare
c3303c8
to
6f23072
Compare
… into rsc * 'main' of github.com:ml-in-barcelona/server-reason-react: Handle DomProps with both jsx and html attribute name (#171) Change setSearch to handle SearchParams.t (#176) doc: add @@platform attribute documentation (#175) Support non-ascii on JS.String.toLowerCase and toUpperCase (#173) Fix snapshot test for external Upperbound reason to 3.10 feat: add nested mel.obj support (#169)
Description
This PR changes the
setSearch
to handle SearchParams.t and addsetSearchString
to handle stringsNew API