Skip to content

feat: add useAllSearchParam hook - #2721

Open
bosi-programming wants to merge 1 commit into
streamich:masterfrom
bosi-programming:pr/use-all-search-param
Open

bosi-programming wants to merge 1 commit into
streamich:masterfrom
bosi-programming:pr/use-all-search-param

Conversation

@bosi-programming

Copy link
Copy Markdown

Description

Adds a useAllSearchParam sensor hook that returns every URL search param as an object, so consumers don't need to instantiate useSearchParam once per param.

Closes #2390.

Repeated params keep their first value (?foo=bar&foo=baz{ foo: 'bar' }), matching useSearchParam's .get() behavior. Server fallback returns {}.

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist

  • Read the Contributing Guide
  • Perform a code self-review
  • Comment the code, particularly in hard-to-understand areas
  • Add documentation
  • Add hook's story at Storybook
  • Cover changes with tests
  • Ensure the test suite passes (yarn test)
  • Provide 100% tests coverage
  • Make sure code lints (yarn lint).
  • Make sure types are fine (yarn lint:types).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a useAllSearchParam hook

1 participant