Improve this doc View source

# `facetUrlStateHandlerService`
service in module `seco.facetedSearch`

## Description

### facetUrlStateHandlerService

Service for updating the URL parameters based on facet selections, and retrieving the facet values from URL parameters.

Intended for bookmarking the current facet selections. `FacetHandler` can take the return value of `getFacetValuesFromUrlParams` as the `initialState` configuration value.

Updating the URL parameters can be done, e.g., when the facet states have been received while listening for facet updates. See `FacetHandler` for details regarding events.

## Methods

- ### getFacetValuesFromUrlParams()

  Get the facet states from the URL parameters.

  ##### Returns

  Object | The facet states.

- ### updateUrlParams(facets)

  Update the URL parameters based on the given facet state.

  ##### Parameters

  Param | Type | Details
  --- | --- | ---
  facets | Object | The facet states as broadcast by `FacetHandler`.