react-instantsearch 6.39.1 → 6.40.0

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.0';
872
874
 
873
875
  function _typeof$2(obj) {
874
876
  "@babel/helpers - typeof";
@@ -5462,7 +5464,7 @@
5462
5464
 
5463
5465
  var requestBuilder_1 = requestBuilder;
5464
5466
 
5465
- var version$1 = '3.11.3';
5467
+ var version$1 = '3.13.0';
5466
5468
 
5467
5469
  var escapeFacetValue$3 = escapeFacetValue_1.escapeFacetValue;
5468
5470
 
@@ -6728,7 +6730,9 @@
6728
6730
 
6729
6731
  var derivedQueries = this.derivedHelpers.map(function(derivedHelper) {
6730
6732
  var derivedState = derivedHelper.getModifiedState(state);
6731
- var derivedStateQueries = requestBuilder_1._getQueries(derivedState.index, derivedState);
6733
+ var derivedStateQueries = derivedState.index
6734
+ ? requestBuilder_1._getQueries(derivedState.index, derivedState)
6735
+ : [];
6732
6736
 
6733
6737
  states.push({
6734
6738
  state: derivedState,
@@ -6745,10 +6749,16 @@
6745
6749
  });
6746
6750
 
6747
6751
  var queries = Array.prototype.concat.apply(mainQueries, derivedQueries);
6748
- var queryId = this._queryId++;
6749
6752
 
6753
+ var queryId = this._queryId++;
6750
6754
  this._currentNbQueries++;
6751
6755
 
6756
+ if (!queries.length) {
6757
+ return Promise.resolve({results: []}).then(
6758
+ this._dispatchAlgoliaResponse.bind(this, states, queryId)
6759
+ );
6760
+ }
6761
+
6752
6762
  try {
6753
6763
  this.client.search(queries)
6754
6764
  .then(this._dispatchAlgoliaResponse.bind(this, states, queryId))
@@ -6793,6 +6803,14 @@
6793
6803
  var helper = s.helper;
6794
6804
  var specificResults = results.splice(0, queriesCount);
6795
6805
 
6806
+ if (!state.index) {
6807
+ helper.emit('result', {
6808
+ results: null,
6809
+ state: state
6810
+ });
6811
+ return;
6812
+ }
6813
+
6796
6814
  var formattedResponse = helper.lastResults = new SearchResults_1(state, specificResults);
6797
6815
 
6798
6816
  helper.emit('result', {