Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Commit

Permalink
refactor(createManager): rename index -> indexId
Browse files Browse the repository at this point in the history
  • Loading branch information
samouss committed Jan 3, 2019
1 parent 14332b7 commit 1546723
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import { HIGHLIGHT_TAGS } from './highlight';
import { hasMultipleIndex } from './indexUtils';

const isMultiIndexContext = widget => hasMultipleIndex(widget.context);
const isTargetedIndexEqualIndex = (widget, index) =>
widget.context.multiIndexContext.targetedIndex === index;
const isTargetedIndexEqualIndex = (widget, indexId) =>
widget.context.multiIndexContext.targetedIndex === indexId;

// Relying on the `indexId` is a bit brittle to detect the `Index` widget.
// Since it's a class we could rely on `instanceof` or similar. We never
// had an issue though. Works for now.
const isIndexWidget = widget => Boolean(widget.props.indexId);
const isIndexWidgetEqualIndex = (widget, index) =>
widget.props.indexId === index;
const isIndexWidgetEqualIndex = (widget, indexId) =>
widget.props.indexId === indexId;

/**
* Creates a new instance of the InstantSearchManager which controls the widgets and
Expand Down

0 comments on commit 1546723

Please sign in to comment.