Constructor
new QueryString(options)
Parameters:
Name | Type | Description |
---|---|---|
options |
Object with a getWindowLocation property, which should be a function returning the current value of window.location. |
- Since:
- 2.0.0
Methods
fullStringWithNewParam(key, value) → {string}
Returns a new URL based on the current location, with the specified query parameter set.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | |
value |
string |
Returns:
- Type
- string
getParam(key) → {string}
Gets the value of the specified query parameter.
Parameters:
Name | Type | Description |
---|---|---|
key |
string |
Returns:
- Type
- string
navigateWithNewParam(key, value)
Sets the specified query parameter and navigates to the resulting URL.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | |
value |
string |