react-instantsearch 6.39.1 → 6.40.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/umd/Dom.js CHANGED
@@ -196,6 +196,9 @@
196
196
  return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
197
197
  }, _typeof(obj);
198
198
  }
199
+ // eslint-disable-next-line @typescript-eslint/unbound-method
200
+ var hasOwn = Object.prototype.hasOwnProperty;
201
+
199
202
  // From https://github.com/reactjs/react-redux/blob/master/src/utils/shallowEqual.js
200
203
  var shallowEqual = function shallowEqual(objA, objB) {
201
204
  if (objA === objB) {
@@ -208,7 +211,6 @@
208
211
  }
209
212
 
210
213
  // Test for A's keys different from B.
211
- var hasOwn = Object.prototype.hasOwnProperty;
212
214
  for (var i = 0; i < keysA.length; i++) {
213
215
  if (!hasOwn.call(objB, keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) {
214
216
  return false;
@@ -868,7 +870,7 @@
868
870
  });
869
871
  }
870
872
 
871
- var version = '6.39.1';
873
+ var version = '6.40.1';
872
874
 
873
875
  function _typeof$2(obj) {
874
876
  "@babel/helpers - typeof";
@@ -4058,7 +4060,10 @@
4058
4060
 
4059
4061
  /**
4060
4062
  * sum of the processing time of all the queries
4063
+ * @name processingTimeMS
4061
4064
  * @member {number}
4065
+ * @memberof SearchResults
4066
+ * @instance
4062
4067
  */
4063
4068
  this.processingTimeMS = results.reduce(function(sum, result) {
4064
4069
  return result.processingTimeMS === undefined
@@ -4264,7 +4269,7 @@
4264
4269
 
4265
4270
  self.facets[position] = {
4266
4271
  name: facetName,
4267
- data: mainSubResponse.facets[facetName],
4272
+ data: mainFacets[facetName],
4268
4273
  exhaustive: mainSubResponse.exhaustiveFacetsCount
4269
4274
  };
4270
4275
  excludes.forEach(function(facetValue) {
@@ -5462,7 +5467,7 @@
5462
5467
 
5463
5468
  var requestBuilder_1 = requestBuilder;
5464
5469
 
5465
- var version$1 = '3.11.3';
5470
+ var version$1 = '3.13.2';
5466
5471
 
5467
5472
  var escapeFacetValue$3 = escapeFacetValue_1.escapeFacetValue;
5468
5473
 
@@ -6728,7 +6733,9 @@
6728
6733
 
6729
6734
  var derivedQueries = this.derivedHelpers.map(function(derivedHelper) {
6730
6735
  var derivedState = derivedHelper.getModifiedState(state);
6731
- var derivedStateQueries = requestBuilder_1._getQueries(derivedState.index, derivedState);
6736
+ var derivedStateQueries = derivedState.index
6737
+ ? requestBuilder_1._getQueries(derivedState.index, derivedState)
6738
+ : [];
6732
6739
 
6733
6740
  states.push({
6734
6741
  state: derivedState,
@@ -6745,10 +6752,16 @@
6745
6752
  });
6746
6753
 
6747
6754
  var queries = Array.prototype.concat.apply(mainQueries, derivedQueries);
6748
- var queryId = this._queryId++;
6749
6755
 
6756
+ var queryId = this._queryId++;
6750
6757
  this._currentNbQueries++;
6751
6758
 
6759
+ if (!queries.length) {
6760
+ return Promise.resolve({results: []}).then(
6761
+ this._dispatchAlgoliaResponse.bind(this, states, queryId)
6762
+ );
6763
+ }
6764
+
6752
6765
  try {
6753
6766
  this.client.search(queries)
6754
6767
  .then(this._dispatchAlgoliaResponse.bind(this, states, queryId))
@@ -6793,6 +6806,14 @@
6793
6806
  var helper = s.helper;
6794
6807
  var specificResults = results.splice(0, queriesCount);
6795
6808
 
6809
+ if (!state.index) {
6810
+ helper.emit('result', {
6811
+ results: null,
6812
+ state: state
6813
+ });
6814
+ return;
6815
+ }
6816
+
6796
6817
  var formattedResponse = helper.lastResults = new SearchResults_1(state, specificResults);
6797
6818
 
6798
6819
  helper.emit('result', {