Hoppa till innehåll

@soleil/parameter-util

Helper functions setting, getting, updating and clearing query parameters in the URL-field.

Polyfill

Requires following polyfills for IE11:

  • Object.assign
  • Object.entries
  • URLSearchParams

Example

import {
getParameters,
setParameters,
updateParameters,
clearParameters,
} from '@soleil/parameter-util';
/* Get parameters from the URL-field */
const params = getParameters();
/* Set parameters in the URL-field, overwriting other parameters */
setParameters({ foo: 'bar' });
/* Update parameters in the URL-field, merging with existing parameters */
updateParameters({ foo: 'bar' });
/* Clear parameters in the URL-field */
clearParameters();