Skip to content

Best practices for saving searches  #670

Description

@calebdel

Issue Type:
enhancement

Platform:
Web, React

Description:
How would you suggest keeping track of the state of selected filters for the purpose of saving a search?

We have a "saved search" feature that I'm trying to refactor (See screenshot) but I can't figure out an ideal way to track the state of which filters have been selected. I've tried the following:

  1. Parsing the URL params. This is messy and in the past some edge cases have ruled this out.

  2. Accessing the ReactiveSearch Redux store. I understand the store is created with the __REACTIVESEARCH__ key, but I can't figure out how to access it.

  3. The "selectedValues" prop in the SelectedFilters component gives me exactly what I need, but I can't access it either.

  4. Currently I'm using the "onValueChange" prop to track state changes and but it isn't ideal for many reasons (primarily reusability across the app.) Related issue (Best way to get the values selected via MultiList(refinement list) #398)

How would you suggest going about this?

My suggestion is to expose the selectedValues prop in the SelectedFilters component.

Reactivesearch version:
2.14.1

Screenshot:
screen shot 2018-12-06 at 1 55 57 pm

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions