How to use the serialize-query-params.updateInLocation function in serialize-query-params

To help you get started, we’ve selected a few serialize-query-params examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pbeshai / use-query-params / src / updateUrlQuery.ts View on Github external
export function updateUrlQuery(
  queryReplacements: EncodedQueryWithNulls,
  location: Location,
  history: PushReplaceHistory,
  updateType: UrlUpdateType = 'replaceIn'
): void {
  switch (updateType) {
    case 'replaceIn':
      history.replace(updateInLocation(queryReplacements, location));
      break;
    case 'pushIn':
      history.push(updateInLocation(queryReplacements, location));
      break;
    case 'replace':
      history.replace(updateLocation(queryReplacements, location));
      break;
    case 'push':
      history.push(updateLocation(queryReplacements, location));
      break;
    default:
  }
}
github pbeshai / use-query-params / src / updateUrlQuery.ts View on Github external
export function updateUrlQuery(
  queryReplacements: EncodedQueryWithNulls,
  location: Location,
  history: PushReplaceHistory,
  updateType: UrlUpdateType = 'replaceIn'
): void {
  switch (updateType) {
    case 'replaceIn':
      history.replace(updateInLocation(queryReplacements, location));
      break;
    case 'pushIn':
      history.push(updateInLocation(queryReplacements, location));
      break;
    case 'replace':
      history.replace(updateLocation(queryReplacements, location));
      break;
    case 'push':
      history.push(updateLocation(queryReplacements, location));
      break;
    default:
  }
}

serialize-query-params

A library for simplifying encoding and decoding URL query parameters.

ISC
Latest version published 2 years ago

Package Health Score

61 / 100
Full package analysis