instantsearch.js 4.74.2 → 4.75.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.
@@ -1,2 +1,8 @@
1
1
  import type { InfiniteHitsCache } from '../../connectors/infinite-hits/connectInfiniteHits';
2
- export default function createInfiniteHitsSessionStorageCache(): InfiniteHitsCache;
2
+ export default function createInfiniteHitsSessionStorageCache({ key, }?: {
3
+ /**
4
+ * If you display multiple instances of infiniteHits on the same page,
5
+ * you must provide a unique key for each instance.
6
+ */
7
+ key?: string;
8
+ }): InfiniteHitsCache;
@@ -8,13 +8,15 @@ function getStateWithoutPage(state) {
8
8
  rest = _objectWithoutProperties(_ref, _excluded);
9
9
  return rest;
10
10
  }
11
- var KEY = 'ais.infiniteHits';
12
11
  export default function createInfiniteHitsSessionStorageCache() {
12
+ var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
13
+ key = _ref2.key;
14
+ var KEY = ['ais.infiniteHits', key].filter(Boolean).join(':');
13
15
  return {
14
- read: function read(_ref2) {
15
- var state = _ref2.state;
16
- var sessionStorage = safelyRunOnBrowser(function (_ref3) {
17
- var window = _ref3.window;
16
+ read: function read(_ref3) {
17
+ var state = _ref3.state;
18
+ var sessionStorage = safelyRunOnBrowser(function (_ref4) {
19
+ var window = _ref4.window;
18
20
  return window.sessionStorage;
19
21
  });
20
22
  if (!sessionStorage) {
@@ -36,11 +38,11 @@ export default function createInfiniteHitsSessionStorageCache() {
36
38
  return null;
37
39
  }
38
40
  },
39
- write: function write(_ref4) {
40
- var state = _ref4.state,
41
- hits = _ref4.hits;
42
- var sessionStorage = safelyRunOnBrowser(function (_ref5) {
43
- var window = _ref5.window;
41
+ write: function write(_ref5) {
42
+ var state = _ref5.state,
43
+ hits = _ref5.hits;
44
+ var sessionStorage = safelyRunOnBrowser(function (_ref6) {
45
+ var window = _ref6.window;
44
46
  return window.sessionStorage;
45
47
  });
46
48
  if (!sessionStorage) {
@@ -1,2 +1,2 @@
1
- declare const _default: "4.74.2";
1
+ declare const _default: "4.75.1";
2
2
  export default _default;
package/es/lib/version.js CHANGED
@@ -1 +1 @@
1
- export default '4.74.2';
1
+ export default '4.75.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instantsearch.js",
3
- "version": "4.74.2",
3
+ "version": "4.75.1",
4
4
  "description": "InstantSearch.js is a JavaScript library for building performant and instant search experiences with Algolia.",
5
5
  "homepage": "https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/",
6
6
  "types": "es/index.d.ts",
@@ -56,9 +56,9 @@
56
56
  "watch:es": "yarn --silent build:es:base --watch"
57
57
  },
58
58
  "devDependencies": {
59
- "@instantsearch/mocks": "1.57.0",
60
- "@instantsearch/tests": "1.57.0",
61
- "@instantsearch/testutils": "1.46.0",
59
+ "@instantsearch/mocks": "1.59.0",
60
+ "@instantsearch/tests": "1.59.0",
61
+ "@instantsearch/testutils": "1.48.0",
62
62
  "@storybook/html": "5.3.9",
63
63
  "@types/scriptjs": "0.0.2",
64
64
  "algoliasearch": "5.1.1",
@@ -66,5 +66,5 @@
66
66
  "scriptjs": "2.5.9",
67
67
  "webpack": "4.47.0"
68
68
  },
69
- "gitHead": "0ae70b92c7c899fcb33f0f93a9ebf17c86cbf03e"
69
+ "gitHead": "bd1f4a7e1cdb277169486c4735ac6651fc053716"
70
70
  }