Search tweak (#123)
* fallback to selectSearchValue in the selectSearchQuery selector
This commit is contained in:
parent
0d4079f370
commit
1f211d183d
2 changed files with 5 additions and 3 deletions
4
dist/bundle.js
vendored
4
dist/bundle.js
vendored
|
@ -3409,8 +3409,8 @@ var selectSuggestions /*: (
|
||||||
return state.suggestions;
|
return state.suggestions;
|
||||||
});
|
});
|
||||||
|
|
||||||
var selectSearchQuery /*: (state: State) => ?string*/ = exports.selectSearchQuery = (0, _reselect.createSelector)(_navigation.selectCurrentPage, _navigation.selectCurrentParams, function (page /*: string*/, params /*: ?{ query: string }*/) {
|
var selectSearchQuery /*: (state: State) => ?string*/ = exports.selectSearchQuery = (0, _reselect.createSelector)(_navigation.selectCurrentPage, _navigation.selectCurrentParams, selectSearchValue, function (page /*: string*/, params /*: ?{ query: string }*/, searchValue /*: string*/) {
|
||||||
return page === 'search' ? params && params.query : null;
|
return page === 'search' ? params && params.query : searchValue;
|
||||||
});
|
});
|
||||||
|
|
||||||
var selectIsSearching /*: (state: State) => boolean*/ = exports.selectIsSearching = (0, _reselect.createSelector)(selectState, function (state) {
|
var selectIsSearching /*: (state: State) => boolean*/ = exports.selectIsSearching = (0, _reselect.createSelector)(selectState, function (state) {
|
||||||
|
|
|
@ -30,7 +30,9 @@ export const selectSuggestions: (
|
||||||
export const selectSearchQuery: (state: State) => ?string = createSelector(
|
export const selectSearchQuery: (state: State) => ?string = createSelector(
|
||||||
selectCurrentPage,
|
selectCurrentPage,
|
||||||
selectCurrentParams,
|
selectCurrentParams,
|
||||||
(page: string, params: ?{ query: string }) => (page === 'search' ? params && params.query : null)
|
selectSearchValue,
|
||||||
|
(page: string, params: ?{ query: string }, searchValue: string) =>
|
||||||
|
page === 'search' ? params && params.query : searchValue
|
||||||
);
|
);
|
||||||
|
|
||||||
export const selectIsSearching: (state: State) => boolean = createSelector(
|
export const selectIsSearching: (state: State) => boolean = createSelector(
|
||||||
|
|
Loading…
Reference in a new issue