Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
Update useSearchParamUpdater.ts to include comments
Browse files Browse the repository at this point in the history
  • Loading branch information
acouch committed Jul 23, 2024
1 parent 60df648 commit 63c1fa3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions frontend/src/hooks/useSearchParamUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@ export function useSearchParamUpdater() {
const params = new URLSearchParams(searchParams);

const updateQueryParams = (
// The parameter value that is not the query term. Query term is treated
// separately because updates to it are captured, ie if a user updates the
// search term and then clicks a facet, the updated term is used.
queryParamValue: string | Set<string>,
// Key of the parameter.
key: string,
queryTerm: string | null | undefined,
// Determines whether the state update scrolls the user to the top. This
// is useful for components that are expected to be "under the fold."
scroll = false,
) => {
const finalQueryParamValue =
Expand Down

0 comments on commit 63c1fa3

Please sign in to comment.