Skip to content

Commit

Permalink
store: set initial loading based on searchOnInit value
Browse files Browse the repository at this point in the history
  • Loading branch information
zzacharo committed Mar 31, 2020
1 parent ff68a95 commit db93030
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/lib/components/ReactSearchKit/ReactSearchKit.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class ReactSearchKit extends Component {
new UrlHandlerApi(props.urlHandlerApi.overrideConfig)
: null,
defaultSortByOnEmptyQuery: props.defaultSortByOnEmptyQuery,
searchOnInit: props.searchOnInit,
};
this.store = configureStore(appConfig);
this.appName = props.appName;
Expand Down
3 changes: 1 addition & 2 deletions src/lib/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@ import { createStore, applyMiddleware } from 'redux';
import { connect } from 'react-redux';
import thunk from 'redux-thunk';

import { INITIAL_STORE_STATE } from './storeConfig';
import rootReducer from './state/reducers';
import { INITIAL_STORE_STATE } from './storeConfig';

export function configureStore(appConfig) {
const initialQueryState = INITIAL_STORE_STATE;

const initialResultsState = {
loading: true,
loading: appConfig.searchOnInit,
data: {
hits: [],
total: 0,
Expand Down

0 comments on commit db93030

Please sign in to comment.