-
Notifications
You must be signed in to change notification settings - Fork 32
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
Query string arguments not supported in makePath #20
Comments
Yup. reverend only generates path, not the query string. But we can use libraries like |
@lingyan - please could you provide a brief example of how these two connect together ? |
Hi @celineotter, routr no longer uese
So that application can provide This issue is a feature request for extending the makePath to be able to take also query params, and generate the href that contains both path and query string. I hope this is what you meant by "how these two connect together" :) |
BTW, we can consider adding the support. The tricky thing is depending on which query string library you use, the query string generated is actually different. For example, between // qs_querystring.js
var qs = require('qs');
var querystring = require('querystring');
var k = {
a: 1,
b: false,
c: {cc: 1},
d: [1,2,3]
};
console.log('qs result is:', qs.stringify(k));
console.log('querystring result is:', querystring.stringify(k)); Running this simple script will output: $ node qs_querystring.js
qs result is: a=1&b=false&c%5Bcc%5D=1&d%5B0%5D=1&d%5B1%5D=2&d%5B2%5D=3
querystring result is: a=1&b=false&c=&d=1&d=2&d=3 I'd prefer using Another option to get around this would be asking developer to pass a pre-built query string, not query params object. |
Hi Y'all, 👍 for qs This is a feature I really miss in routr and more especially in fluxible-router. Is anyone working on a pull request? Thanks, |
@bchelli no one is at the moment, if you would like to try it out and open a PR, that would be great! |
Instead of picking a library we could ask users to provide it in the constructor. It must provide a |
[resolves #20] Add support for parsing and constructing urls with query params
The use of "reverend" in MakePath does not support having querystring params.
The text was updated successfully, but these errors were encountered: