instantsearch.js 4.50.1 → 4.50.2
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/cjs/connectors/infinite-hits/connectInfiniteHits.js +8 -1
- package/cjs/lib/version.js +1 -1
- package/cjs/widgets/index/index.js +3 -0
- package/dist/instantsearch.development.d.ts +1 -0
- package/dist/instantsearch.development.js +13 -3
- package/dist/instantsearch.development.js.map +1 -1
- package/dist/instantsearch.production.d.ts +1 -0
- package/dist/instantsearch.production.min.d.ts +1 -0
- package/dist/instantsearch.production.min.js +2 -2
- package/dist/instantsearch.production.min.js.map +1 -1
- package/es/connectors/infinite-hits/connectInfiniteHits.js +8 -1
- package/es/lib/version.d.ts +1 -1
- package/es/lib/version.js +1 -1
- package/es/widgets/index/index.d.ts +1 -0
- package/es/widgets/index/index.js +3 -0
- package/package.json +5 -5
|
@@ -128,10 +128,17 @@ var connectInfiniteHits = function connectInfiniteHits(renderFn) {
|
|
|
128
128
|
getWidgetRenderState: function getWidgetRenderState(_ref5) {
|
|
129
129
|
var results = _ref5.results,
|
|
130
130
|
helper = _ref5.helper,
|
|
131
|
-
|
|
131
|
+
parent = _ref5.parent,
|
|
132
|
+
existingState = _ref5.state,
|
|
132
133
|
instantSearchInstance = _ref5.instantSearchInstance;
|
|
133
134
|
var isFirstPage;
|
|
134
135
|
var currentPageHits = [];
|
|
136
|
+
/**
|
|
137
|
+
* We bail out of optimistic UI here, as the cache is based on search
|
|
138
|
+
* parameters, and we don't want to invalidate the cache when the search
|
|
139
|
+
* is loading.
|
|
140
|
+
*/
|
|
141
|
+
var state = parent.getPreviousState() || existingState;
|
|
135
142
|
var cachedHits = cache.read({
|
|
136
143
|
state: state
|
|
137
144
|
}) || {};
|
package/es/lib/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "4.50.
|
|
1
|
+
declare const _default: "4.50.2";
|
|
2
2
|
export default _default;
|
package/es/lib/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '4.50.
|
|
1
|
+
export default '4.50.2';
|
|
@@ -23,6 +23,7 @@ export type IndexWidget = Omit<Widget<IndexWidgetDescription & {
|
|
|
23
23
|
getIndexId(): string;
|
|
24
24
|
getHelper(): Helper | null;
|
|
25
25
|
getResults(): SearchResults | null;
|
|
26
|
+
getPreviousState(): SearchParameters | null;
|
|
26
27
|
getScopedResults(): ScopedResult[];
|
|
27
28
|
getParent(): IndexWidget | null;
|
|
28
29
|
getWidgets(): Array<Widget | IndexWidget>;
|
|
@@ -126,6 +126,9 @@ var index = function index(widgetParams) {
|
|
|
126
126
|
derivedHelper.lastResults._state = helper.state;
|
|
127
127
|
return derivedHelper.lastResults;
|
|
128
128
|
},
|
|
129
|
+
getPreviousState: function getPreviousState() {
|
|
130
|
+
return lastValidSearchParameters;
|
|
131
|
+
},
|
|
129
132
|
getScopedResults: function getScopedResults() {
|
|
130
133
|
var widgetParent = this.getParent();
|
|
131
134
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "instantsearch.js",
|
|
3
|
-
"version": "4.50.
|
|
3
|
+
"version": "4.50.2",
|
|
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",
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
"version": "./scripts/version/update-version.js"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@instantsearch/mocks": "1.
|
|
59
|
-
"@instantsearch/tests": "1.
|
|
60
|
-
"@instantsearch/testutils": "1.0.
|
|
58
|
+
"@instantsearch/mocks": "1.3.0",
|
|
59
|
+
"@instantsearch/tests": "1.3.0",
|
|
60
|
+
"@instantsearch/testutils": "1.0.6",
|
|
61
61
|
"@storybook/html": "5.3.9",
|
|
62
62
|
"@types/scriptjs": "0.0.2",
|
|
63
63
|
"algoliasearch": "4.14.3",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"scriptjs": "2.5.9",
|
|
66
66
|
"webpack": "4.41.5"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "929c1d782d17a0d743f8a16d8d7e2231534658e7"
|
|
69
69
|
}
|