currentView: string;
open: boolean;
searchResults: GroupContentsResource[];
+ searchValue: string;
}
export enum SearchView {
const initialState: SearchBar = {
currentView: SearchView.BASIC,
open: false,
- searchResults: []
+ searchResults: [],
+ searchValue: ''
};
export const searchBarReducer = (state = initialState, action: SearchBarActions): SearchBar =>
OPEN_SEARCH_VIEW: () => ({ ...state, open: true }),
CLOSE_SEARCH_VIEW: () => ({ ...state, open: false }),
SET_SEARCH_RESULTS: (searchResults) => ({ ...state, searchResults }),
+ SET_SEARCH_VALUE: (searchValue) => ({ ...state, searchValue }),
default: () => state
});
\ No newline at end of file