Skip to content

Commit

Permalink
perf(hitsPerPageSelector): Use the correct lodash function
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerska committed Nov 5, 2015
1 parent 1d6a92f commit be9aea7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions widgets/hits-per-page-selector/hits-per-page-selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ let React = require('react');
let ReactDOM = require('react-dom');

let utils = require('../../lib/utils.js');
let reduce = require('lodash/collection/reduce');
let any = require('lodash/collection/any');
let bem = utils.bemHelper('ais-hits-per-page-selector');
let cx = require('classnames');
let autoHideContainer = require('../../decorators/autoHideContainer');
Expand Down Expand Up @@ -40,9 +40,9 @@ function hitsPerPageSelector({

return {
init: function(state) {
let isCurrentInOptions = reduce(options, function(res, option) {
return res || +state.hitsPerPage === +option.value;
}, false);
let isCurrentInOptions = any(options, function(option) {
return +state.hitsPerPage === +option.value;
});

if (!isCurrentInOptions) {
options = [{value: undefined, label: ''}].concat(options);
Expand Down

0 comments on commit be9aea7

Please sign in to comment.