Skip to content

Commit

Permalink
fix(connectQueryRules): improve tracked refinement type (#3648)
Browse files Browse the repository at this point in the history
  • Loading branch information
francoischalifour authored Apr 3, 2019
1 parent b8f8b4e commit e16ad57
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/connectors/query-rules/connectQueryRules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ import {
NumericRefinement as InternalNumericRefinement,
} from '../../lib/utils/getRefinements';

type TrackedFilterRefinement = string | number | boolean;

export type ParamTrackedFilters = {
[facetName: string]: (
facetValues: Array<string | number>
) => Array<string | number>;
facetValues: TrackedFilterRefinement[]
) => TrackedFilterRefinement[];
};
export type ParamTransformRuleContexts = (ruleContexts: string[]) => string[];
type ParamTransformItems = (items: object[]) => any;
Expand Down Expand Up @@ -85,7 +87,7 @@ function getRuleContextsFromTrackedFilters({
}) {
const ruleContexts = Object.keys(trackedFilters).reduce<string[]>(
(facets, facetName) => {
const facetRefinements: Array<string | number> = getRefinements(
const facetRefinements: TrackedFilterRefinement[] = getRefinements(
helper.lastResults || {},
sharedHelperState
)
Expand Down

0 comments on commit e16ad57

Please sign in to comment.