blob: 50233a711b2ed6763a179407a3b0b7c2031839f5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
const DEFAULT_STATE = {
searchInput: '',
searchResults: [],
hasFocus: false,
};
const search = (state = DEFAULT_STATE, action) => {
switch (action.type) {
case 'SEARCH/INPUT_CHANGE':
return {
...state,
searchInput: action.typedValue,
searchResults: [
{ type: 's', value: '18561' },
],
};
case 'SEARCH/FOCUS_CHANGE':
return {
...state,
hasFocus: action.hasFocus,
};
default:
return state;
}
};
export default search;
|