Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' into feat/search-client
Browse files Browse the repository at this point in the history
  • Loading branch information
samouss authored May 17, 2018
2 parents 0493b8e + d0f319e commit 4e33880
Show file tree
Hide file tree
Showing 7 changed files with 244 additions and 136 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.11.1
8.11.2
20 changes: 10 additions & 10 deletions docgen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
},
"devDependencies": {
"algolia-aerial": "1.3.4",
"algolia-frontend-components": "0.0.34",
"algolia-frontend-components": "0.0.35",
"async": "2.6.0",
"autoprefixer": "8.4.1",
"autoprefixer": "8.5.0",
"babel-cli": "6.26.0",
"babel-core": "6.26.0",
"babel-loader": "7.1.4",
"babel-plugin-inline-json-import": "0.2.1",
"babel-plugin-lodash": "3.3.2",
"babel-plugin-transform-react-jsx-source": "6.22.0",
"babel-preset-env": "1.6.1",
"babel-preset-env": "1.7.0",
"babel-preset-react": "6.24.1",
"babel-preset-stage-2": "6.24.1",
"browser-sync": "2.24.4",
Expand All @@ -29,9 +29,9 @@
"compression": "1.7.2",
"css-loader": "0.28.11",
"escape-html": "1.0.3",
"fs-extra": "6.0.0",
"fs-extra": "6.0.1",
"glob": "7.1.2",
"google-map-react": "1.0.0",
"google-map-react": "1.0.3",
"happypack": "5.0.0",
"hasha": "3.0.0",
"instantsearch.css": "7.0.0",
Expand All @@ -41,7 +41,7 @@
"lodash": "4.17.10",
"markdown-it": "8.4.1",
"markdown-it-anchor": "4.0.0",
"material-ui": "0.20.0",
"material-ui": "0.20.1",
"metalsmith": "2.3.0",
"metalsmith-headings": "0.2.0",
"metalsmith-layouts": "2.1.0",
Expand All @@ -56,16 +56,16 @@
"qs": "6.5.2",
"react": "16.3.2",
"react-dom": "16.3.2",
"react-hot-loader": "4.1.2",
"react-hot-loader": "4.2.0",
"react-tap-event-plugin": "3.0.2",
"recursive-readdir": "2.2.2",
"replace-in-file": "3.4.0",
"rheostat": "2.1.3",
"stat-mode": "0.2.2",
"style-loader": "0.21.0",
"webpack": "3.11.0",
"webpack-bundle-analyzer": "2.11.1",
"webpack": "3.12.0",
"webpack-bundle-analyzer": "2.12.0",
"webpack-dev-middleware": "2.0.6",
"webpack-hot-middleware": "2.22.1"
"webpack-hot-middleware": "2.22.2"
}
}
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@
"docs:storybook-build-production": "build-storybook -s ./storybook/public -o docgen/docs-production/react-instantsearch/storybook -c ./storybook"
},
"devDependencies": {
"@storybook/addon-actions": "3.4.3",
"@storybook/addon-knobs": "3.4.3",
"@storybook/addon-links": "3.4.3",
"@storybook/addon-options": "3.4.3",
"@storybook/addons": "3.4.3",
"@storybook/react": "3.4.3",
"@storybook/ui": "3.4.3",
"@storybook/addon-actions": "3.4.4",
"@storybook/addon-knobs": "3.4.4",
"@storybook/addon-links": "3.4.4",
"@storybook/addon-options": "3.4.4",
"@storybook/addons": "3.4.4",
"@storybook/react": "3.4.4",
"@storybook/ui": "3.4.4",
"argos-cli": "0.0.9",
"babel-core": "6.26.0",
"babel-eslint": "8.2.3",
"babel-loader": "7.1.4",
"babel-plugin-inline-json-import": "0.2.1",
"babel-plugin-lodash": "3.3.2",
"babel-plugin-transform-react-jsx-source": "6.22.0",
"babel-preset-env": "1.6.1",
"babel-preset-env": "1.7.0",
"babel-preset-react": "6.24.1",
"babel-preset-stage-2": "6.24.1",
"conventional-changelog-cli": "1.3.22",
Expand Down Expand Up @@ -72,10 +72,10 @@
"storybook-addon-a11y": "3.1.9",
"storybook-addon-jsx": "5.3.0",
"style-loader": "0.21.0",
"webpack": "3.11.0"
"webpack": "3.12.0"
},
"engines": {
"node": "8.11.1",
"node": "8.11.2",
"yarn": "1.5.1"
},
"jest": {
Expand Down
6 changes: 3 additions & 3 deletions packages/react-instantsearch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"babel-plugin-inline-json-import": "0.2.1",
"babel-plugin-lodash": "3.3.2",
"babel-plugin-transform-react-jsx-source": "6.22.0",
"babel-preset-env": "1.6.1",
"babel-preset-env": "1.7.0",
"babel-preset-react": "6.24.1",
"babel-preset-stage-2": "6.24.1",
"bundlesize": "0.17.0",
Expand All @@ -54,11 +54,11 @@
"react-dom": "16.3.2",
"react-native": "0.54.2",
"react-test-renderer": "16.3.2",
"rollup": "0.58.2",
"rollup": "0.59.1",
"rollup-plugin-babel": "3.0.4",
"rollup-plugin-commonjs": "9.1.3",
"rollup-plugin-filesize": "1.5.0",
"rollup-plugin-node-globals": "1.2.0",
"rollup-plugin-node-globals": "1.2.1",
"rollup-plugin-node-resolve": "3.3.0",
"rollup-plugin-replace": "2.0.0",
"rollup-plugin-uglify": "3.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export default createConnector({
const results = getResults(searchResults, this.context);

this._allResults = this._allResults || [];
this._previousPage = this._previousPage || 0;

if (!results) {
return {
Expand All @@ -56,16 +57,16 @@ export default createConnector({

if (page === 0) {
this._allResults = hits;
} else if (page > this.previousPage) {
} else if (page > this._previousPage) {
this._allResults = [...this._allResults, ...hits];
} else if (page < this.previousPage) {
} else if (page < this._previousPage) {
this._allResults = hits;
}

const lastPageIndex = nbPages - 1;
const hasMore = page < lastPageIndex;

this.previousPage = page;
this._previousPage = page;

return {
hits: this._allResults,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ describe('connectInfiniteHits', () => {
};

const expectation = {
hits: [],
hits: [{}, {}, {}],
hasMore: true,
};

Expand Down
Loading

0 comments on commit 4e33880

Please sign in to comment.