How to use the algoliasearch-helper.url function in algoliasearch-helper

To help you get started, we’ve selected a few algoliasearch-helper examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github algolia / react-instantsearch / src / lib / url-sync.js View on Github external
createURL(state, {absolute}) {
    const currentQueryString = this.urlUtils.readUrl();
    const filteredState = state.filter(this.trackedParameters);
    const foreignConfig = algoliasearchHelper
      .url
      .getUnrecognizedParametersInQueryString(currentQueryString, {mapping: this.mapping});
    // Add instantsearch version to reconciliate old url with newer versions
    // eslint-disable-next-line camelcase
    foreignConfig.is_v = majorVersionNumber;
    const relative = this
      .urlUtils
      .createURL(algoliasearchHelper.url.getQueryStringFromState(filteredState, {mapping: this.mapping}));

    return absolute ? getFullURL(relative) : relative;
  }
github algolia / react-instantsearch / src / lib / url-sync.js View on Github external
createURL(state, {absolute}) {
    const currentQueryString = this.urlUtils.readUrl();
    const filteredState = state.filter(this.trackedParameters);
    const foreignConfig = algoliasearchHelper
      .url
      .getUnrecognizedParametersInQueryString(currentQueryString, {mapping: this.mapping});
    // Add instantsearch version to reconciliate old url with newer versions
    // eslint-disable-next-line camelcase
    foreignConfig.is_v = majorVersionNumber;
    const relative = this
      .urlUtils
      .createURL(algoliasearchHelper.url.getQueryStringFromState(filteredState, {mapping: this.mapping}));

    return absolute ? getFullURL(relative) : relative;
  }
github algolia / react-instantsearch / src / lib / main.js View on Github external
refinementList: require('../widgets/refinement-list/refinement-list.js'),
  numericRefinementList: require('../widgets/numeric-refinement-list/numeric-refinement-list.js'),
  numericSelector: require('../widgets/numeric-selector/numeric-selector.js'),
  pagination: require('../widgets/pagination/pagination.js'),
  priceRanges: require('../widgets/price-ranges/price-ranges.js'),
  searchBox: require('../widgets/search-box/search-box.js'),
  rangeSlider: require('../widgets/range-slider/range-slider.js'),
  sortBySelector: require('../widgets/sort-by-selector/sort-by-selector.js'),
  starRating: require('../widgets/star-rating/star-rating.js'),
  stats: require('../widgets/stats/stats.js'),
  toggle: require('../widgets/toggle/toggle.js')
};

instantsearch.version = require('./version.js');

instantsearch.createQueryString = algoliasearchHelper.url.getQueryStringFromState;

export default instantsearch;